diff --git a/README.md b/README.md index 5cd7cecf..2dc81dbd 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,83 @@ -# Project +# Microsoft 365 Agents SDK - Python -> This repo has been populated by an initial template to help get you started. Please -> make sure to update the content to build a great experience for community-building. +![Build Status](https://github.com/microsoft/Agents-for-python/actions/workflows/python-package.yml/badge.svg) +![PyPI Downloads](https://img.shields.io/pypi/dm/microsoft-agents-activity) -As the maintainer of this project, please make a few updates: +The Microsoft 365 Agent SDK simplifies building full stack, multichannel, trusted agents for platforms including M365, Teams, Copilot Studio, and Webchat. We also offer integrations with 3rd parties such as Facebook Messenger, Slack, or Twilio. The SDK provides developers with the building blocks to create agents that handle user interactions, orchestrate requests, reason responses, and collaborate with other agents. -- Improving this README.MD file to provide a great experience -- Updating SUPPORT.MD with content about this project's support experience -- Understanding the security reporting process in SECURITY.MD -- Remove this section from the README +The M365 Agent SDK is a comprehensive framework for building enterprise-grade agents, enabling developers to integrate components from the Azure AI Foundry SDK, Semantic Kernel, as well as AI components from other vendors. + +For more information please see the parent project information here [Microsoft 365 Agents SDK](https://aka.ms/agents) + +## Getting Started + +The best way to get started with these packages is to look at the samples available in [https://github.com/microsoft/Agents](https://github.com/microsoft/Agents) + +## Important Notice - Import Changes + +> **⚠️ Breaking Change**: Recent updates have changed the Python import structure from `microsoft.agents` to `microsoft_agents` (using underscores instead of dots). Please update your imports accordingly. + +### Import Examples + +```python +# Activity types and models +from microsoft_agents.activity import Activity + +# Core hosting functionality +from microsoft_agents.hosting.core import TurnContext + +# aiohttp hosting +from microsoft_agents.hosting.aiohttp import start_agent_process + +# Teams-specific functionality (compatible only with activity handler) +from microsoft_agents.hosting.teams import TeamsActivityHandler + +# Azure Blob storage +from microsoft_agents.storage.blob import BlobStorage + +# CosmosDB storage +from microsoft_agents.storage.cosmos import CosmosDbStorage + +# MSAL authentication +from microsoft_agents.authentication.msal import MsalAuth + +# Copilot Studio client +from microsoft_agents.copilotstudio.client import CopilotClient +``` + +## Packages Overview + +We offer the following PyPI packages to create conversational experiences based on Agents: + +| Package Name | PyPI Version | Description | Replaces | +|--------------|-------------|-------------|----------| +| `microsoft-agents-activity` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-activity)](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. | `botframework-schema` | +| `microsoft-agents-hosting-core` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-core)](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. | `botbuilder-core, botframework-connector` | +| `microsoft-agents-hosting-aiohttp` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-aiohttp)](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. | `botbuilder-integration-aiohttp` | +| `microsoft-agents-hosting-teams` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-teams)](https://pypi.org/project/microsoft-agents-hosting-teams/) | Provides classes to host an Agent for Teams. | N/A | +| `microsoft-agents-storage-blob` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-storage-blob)](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. | `botbuilder-azure` | +| `microsoft-agents-storage-cosmos` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-storage-cosmos)](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. | `botbuilder-azure` | +| `microsoft-agents-authentication-msal` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-authentication-msal)](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. | N/A | + +Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio: + +| Package Name | PyPI Version | Description | +|--------------|-------------|-------------| +| `microsoft-agents-copilotstudio-client` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-copilotstudio-client)](https://pypi.org/project/microsoft-agents-copilotstudio-client/) | Direct to Engine client to interact with Agents created in CopilotStudio | + +### Environment requirements + +The packages should target Python 3.9 or greater, and can be used with modern Python package managers like pip, poetry, or conda. + +> Note: We recommend using Python 3.11 or later for optimal performance and compatibility with all features. + +### Debugging + +The packages include source code to allow debugging in your preferred Python IDE or debugger. + +### Code Style + +We are using `black` and `flake8` for code formatting and linting. ## Contributing diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/__init__.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/__init__.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/__init__.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/__init__.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/_load_configuration.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/_load_configuration.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/_load_configuration.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/_load_configuration.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/_type_aliases.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/_type_aliases.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/_type_aliases.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/_type_aliases.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/action_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/action_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/action_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/action_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/activity.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/activity.py similarity index 95% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/activity.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/activity.py index 67a359ad..1d5f8f56 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/activity.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/activity.py @@ -27,7 +27,7 @@ class Activity(AgentsModel): 'endOfConversation', 'event', 'invoke', 'deleteUserData', 'messageUpdate', 'messageDelete', 'installationUpdate', 'messageReaction', 'suggestion', 'trace', 'handoff' - :type type: str or ~microsoft.agents.protocols.models.ActivityTypes + :type type: str or ~microsoft_agents.protocols.models.ActivityTypes :param id: Contains an ID that uniquely identifies the activity on the channel. :type id: str :param timestamp: Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format. @@ -43,23 +43,23 @@ class Activity(AgentsModel): :param channel_id: Contains an ID that uniquely identifies the channel. Set by the channel. :type channel_id: str :param from_property: Identifies the sender of the message. - :type from_property: ~microsoft.agents.protocols.models.ChannelAccount + :type from_property: ~microsoft_agents.protocols.models.ChannelAccount :param conversation: Identifies the conversation to which the activity belongs. - :type conversation: ~microsoft.agents.protocols.models.ConversationAccount + :type conversation: ~microsoft_agents.protocols.models.ConversationAccount :param recipient: Identifies the recipient of the message. - :type recipient: ~microsoft.agents.protocols.models.ChannelAccount + :type recipient: ~microsoft_agents.protocols.models.ChannelAccount :param text_format: Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml' - :type text_format: str or ~microsoft.agents.protocols.models.TextFormatTypes + :type text_format: str or ~microsoft_agents.protocols.models.TextFormatTypes :param attachment_layout: The layout hint for multiple attachments. Default: list. Possible values include: 'list', 'carousel' - :type attachment_layout: str or ~microsoft.agents.protocols.models.AttachmentLayoutTypes + :type attachment_layout: str or ~microsoft_agents.protocols.models.AttachmentLayoutTypes :param members_added: The collection of members added to the conversation. - :type members_added: list[~microsoft.agents.protocols.models.ChannelAccount] + :type members_added: list[~microsoft_agents.protocols.models.ChannelAccount] :param members_removed: The collection of members removed from the conversation. - :type members_removed: list[~microsoft.agents.protocols.models.ChannelAccount] + :type members_removed: list[~microsoft_agents.protocols.models.ChannelAccount] :param reactions_added: The collection of reactions added to the conversation. - :type reactions_added: list[~microsoft.agents.protocols.models.MessageReaction] + :type reactions_added: list[~microsoft_agents.protocols.models.MessageReaction] :param reactions_removed: The collection of reactions removed from the conversation. - :type reactions_removed: list[~microsoft.agents.protocols.models.MessageReaction] + :type reactions_removed: list[~microsoft_agents.protocols.models.MessageReaction] :param topic_name: The updated topic name of the conversation. :type topic_name: str :param history_disclosed: Indicates whether the prior history of the channel is disclosed. @@ -74,15 +74,15 @@ class Activity(AgentsModel): :type speak: str :param input_hint: Indicates whether your agent is accepting, expecting, or ignoring user input after the message is delivered to the client. Possible values include: 'acceptingInput', 'ignoringInput', 'expectingInput' - :type input_hint: str or ~microsoft.agents.protocols.models.InputHints + :type input_hint: str or ~microsoft_agents.protocols.models.InputHints :param summary: The text to display if the channel cannot render cards. :type summary: str :param suggested_actions: The suggested actions for the activity. - :type suggested_actions: ~microsoft.agents.protocols.models.SuggestedActions + :type suggested_actions: ~microsoft_agents.protocols.models.SuggestedActions :param attachments: Attachments - :type attachments: list[~microsoft.agents.protocols.models.Attachment] + :type attachments: list[~microsoft_agents.protocols.models.Attachment] :param entities: Represents the entities that were mentioned in the message. - :type entities: list[~microsoft.agents.protocols.models.Entity] + :type entities: list[~microsoft_agents.protocols.models.Entity] :param channel_data: Contains channel-specific content. :type channel_data: object :param action: Indicates whether the recipient of a contactRelationUpdate was added or removed from the sender's contact list. @@ -98,23 +98,23 @@ class Activity(AgentsModel): :param name: The name of the operation associated with an invoke or event activity. :type name: str :param relates_to: A reference to another conversation or activity. - :type relates_to: ~microsoft.agents.protocols.models.ConversationReference + :type relates_to: ~microsoft_agents.protocols.models.ConversationReference :param code: The a code for endOfConversation activities that indicates why the conversation ended. Possible values include: 'unknown', 'completedSuccessfully', 'userCancelled', 'botTimedOut', 'botIssuedInvalidMessage', 'channelFailed' - :type code: str or ~microsoft.agents.protocols.models.EndOfConversationCodes + :type code: str or ~microsoft_agents.protocols.models.EndOfConversationCodes :param expiration: The time at which the activity should be considered to be "expired" and should not be presented to the recipient. :type expiration: datetime :param importance: The importance of the activity. Possible values include: 'low', 'normal', 'high' - :type importance: str or ~microsoft.agents.protocols.models.ActivityImportance + :type importance: str or ~microsoft_agents.protocols.models.ActivityImportance :param delivery_mode: A delivery hint to signal to the recipient alternate delivery paths for the activity. The default delivery mode is "default". Possible values include: 'normal', 'notification', 'expectReplies', 'ephemeral' - :type delivery_mode: str or ~microsoft.agents.protocols.models.DeliveryModes + :type delivery_mode: str or ~microsoft_agents.protocols.models.DeliveryModes :param listen_for: List of phrases and references that speech and language priming systems should listen for :type listen_for: list[str] :param text_highlights: The collection of text fragments to highlight when the activity contains a ReplyToId value. - :type text_highlights: list[~microsoft.agents.protocols.models.TextHighlight] + :type text_highlights: list[~microsoft_agents.protocols.models.TextHighlight] :param semantic_action: An optional programmatic action accompanying this request - :type semantic_action: ~microsoft.agents.protocols.models.SemanticAction + :type semantic_action: ~microsoft_agents.protocols.models.SemanticAction :param caller_id: A string containing an IRI identifying the caller of an agent. This field is not intended to be transmitted over the wire, but is instead populated by agents and clients based on cryptographically verifiable data that asserts the identity of the callers (e.g. tokens). :type caller_id: str diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/activity_event_names.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/activity_event_names.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/activity_event_names.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/activity_event_names.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/activity_importance.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/activity_importance.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/activity_importance.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/activity_importance.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/activity_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/activity_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/activity_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/activity_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/adaptive_card_invoke_action.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/adaptive_card_invoke_action.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/adaptive_card_invoke_action.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/adaptive_card_invoke_action.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/adaptive_card_invoke_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/adaptive_card_invoke_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/adaptive_card_invoke_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/adaptive_card_invoke_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/adaptive_card_invoke_value.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/adaptive_card_invoke_value.py similarity index 87% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/adaptive_card_invoke_value.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/adaptive_card_invoke_value.py index ef928e0b..b942a2af 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/adaptive_card_invoke_value.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/adaptive_card_invoke_value.py @@ -10,9 +10,9 @@ class AdaptiveCardInvokeValue(AgentsModel): Defines the structure that arrives in the Activity.Value for Invoke activity with Name of 'adaptiveCard/action'. :param action: The action of this adaptive card invoke action value. - :type action: :class:`microsoft.agents.activity.models.AdaptiveCardInvokeAction` + :type action: :class:`microsoft_agents.activity.models.AdaptiveCardInvokeAction` :param authentication: The TokenExchangeInvokeRequest for this adaptive card invoke action value. - :type authentication: :class:`microsoft.agents.activity.models.TokenExchangeInvokeRequest` + :type authentication: :class:`microsoft_agents.activity.models.TokenExchangeInvokeRequest` :param state: The 'state' or magic code for an OAuth flow. :type state: str """ diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/agents_model.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/agents_model.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/agents_model.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/agents_model.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/ai_entity.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/ai_entity.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/ai_entity.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/ai_entity.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/animation_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/animation_card.py similarity index 90% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/animation_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/animation_card.py index ed6b8115..9c398e05 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/animation_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/animation_card.py @@ -15,12 +15,12 @@ class AnimationCard(AgentsModel): :param text: Text of this card :type text: str :param image: Thumbnail placeholder - :type image: ~microsoft.agents.protocols.models.ThumbnailUrl + :type image: ~microsoft_agents.protocols.models.ThumbnailUrl :param media: Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. - :type media: list[~microsoft.agents.protocols.models.MediaUrl] + :type media: list[~microsoft_agents.protocols.models.MediaUrl] :param buttons: Actions on this card - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] :param shareable: This content may be shared with others (default:true) :type shareable: bool :param autoloop: Should the client loop playback at end of content diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/attachment.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/attachment.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/attachment.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/attachment.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_data.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_data.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_data.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_data.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_info.py similarity index 88% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_info.py index e1ac76bd..8607ed7b 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_info.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_info.py @@ -11,7 +11,7 @@ class AttachmentInfo(AgentsModel): :param type: ContentType of the attachment :type type: str :param views: attachment views - :type views: list[~microsoft.agents.protocols.models.AttachmentView] + :type views: list[~microsoft_agents.protocols.models.AttachmentView] """ name: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_layout_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_layout_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_layout_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_layout_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_view.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_view.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/attachment_view.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/attachment_view.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/audio_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/audio_card.py similarity index 90% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/audio_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/audio_card.py index d6cef0e2..b8675131 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/audio_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/audio_card.py @@ -15,12 +15,12 @@ class AudioCard(AgentsModel): :param text: Text of this card :type text: str :param image: Thumbnail placeholder - :type image: ~microsoft.agents.protocols.models.ThumbnailUrl + :type image: ~microsoft_agents.protocols.models.ThumbnailUrl :param media: Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. - :type media: list[~microsoft.agents.protocols.models.MediaUrl] + :type media: list[~microsoft_agents.protocols.models.MediaUrl] :param buttons: Actions on this card - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] :param shareable: This content may be shared with others (default:true) :type shareable: bool :param autoloop: Should the client loop playback at end of content diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/basic_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/basic_card.py similarity index 80% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/basic_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/basic_card.py index 76d8e0d8..d8eb2499 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/basic_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/basic_card.py @@ -14,12 +14,12 @@ class BasicCard(AgentsModel): :param text: Text for the card :type text: str :param images: Array of images for the card - :type images: list[~microsoft.agents.protocols.models.CardImage] + :type images: list[~microsoft_agents.protocols.models.CardImage] :param buttons: Set of actions applicable to the current card - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] :param tap: This action will be activated when user taps on the card itself - :type tap: ~microsoft.agents.protocols.models.CardAction + :type tap: ~microsoft_agents.protocols.models.CardAction """ title: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/caller_id_constants.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/caller_id_constants.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/caller_id_constants.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/caller_id_constants.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/card_action.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/card_action.py similarity index 95% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/card_action.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/card_action.py index 677d251a..cfbc200c 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/card_action.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/card_action.py @@ -9,7 +9,7 @@ class CardAction(AgentsModel): :param type: The type of action implemented by this button. Possible values include: 'openUrl', 'imBack', 'postBack', 'playAudio', 'playVideo', 'showImage', 'downloadFile', 'signin', 'call', 'messageBack' - :type type: str or ~microsoft.agents.protocols.models.ActionTypes + :type type: str or ~microsoft_agents.protocols.models.ActionTypes :param title: Text description which appears on the button :type title: str :param image: Image URL which will appear on the button, next to text diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/card_image.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/card_image.py similarity index 88% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/card_image.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/card_image.py index a47555f9..e830e1a9 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/card_image.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/card_image.py @@ -11,7 +11,7 @@ class CardImage(AgentsModel): :param alt: Image description intended for screen readers :type alt: str :param tap: Action assigned to specific Attachment - :type tap: ~microsoft.agents.protocols.models.CardAction + :type tap: ~microsoft_agents.protocols.models.CardAction """ url: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/channel_account.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/channel_account.py similarity index 93% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/channel_account.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/channel_account.py index 58c798f3..b686d9c9 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/channel_account.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/channel_account.py @@ -17,7 +17,7 @@ class ChannelAccount(AgentsModel): Directory (AAD) :type aad_object_id: str :param role: Role of the entity behind the account - :type role: str or ~microsoft.agents.protocols.models.RoleTypes + :type role: str or ~microsoft_agents.protocols.models.RoleTypes """ model_config = ConfigDict(extra="allow") diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/channel_adapter_protocol.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/channel_adapter_protocol.py similarity index 98% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/channel_adapter_protocol.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/channel_adapter_protocol.py index 79906b30..e24e2b07 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/channel_adapter_protocol.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/channel_adapter_protocol.py @@ -2,7 +2,7 @@ from typing import Protocol, List, Callable, Awaitable, Optional from .turn_context_protocol import TurnContextProtocol -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, ResourceResponse, ConversationReference, diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/channels.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/channels.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/channels.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/channels.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/contact_relation_update_action_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/contact_relation_update_action_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/contact_relation_update_action_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/contact_relation_update_action_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_account.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_account.py similarity index 95% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_account.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_account.py index 14885d10..31a2a9f4 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_account.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_account.py @@ -21,7 +21,7 @@ class ConversationAccount(AgentsModel): Directory (AAD) :type aad_object_id: str :param role: Role of the entity behind the account - :type role: str or ~microsoft.agents.protocols.models.RoleTypes + :type role: str or ~microsoft_agents.protocols.models.RoleTypes :param tenant_id: This conversation's tenant ID :type tenant_id: str :param properties: This conversation's properties diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_members.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_members.py similarity index 86% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_members.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_members.py index c61c6e33..a80692fb 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_members.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_members.py @@ -9,7 +9,7 @@ class ConversationMembers(AgentsModel): :param id: Conversation ID :type id: str :param members: List of members in this conversation - :type members: list[~microsoft.agents.protocols.models.ChannelAccount] + :type members: list[~microsoft_agents.protocols.models.ChannelAccount] """ id: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_parameters.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_parameters.py similarity index 86% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_parameters.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_parameters.py index e9bcf9c2..fe8cf432 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_parameters.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_parameters.py @@ -12,15 +12,15 @@ class ConversationParameters(AgentsModel): :param is_group: IsGroup :type is_group: bool :param agent: The agent address for this conversation - :type agent: ~microsoft.agents.protocols.models.ChannelAccount + :type agent: ~microsoft_agents.protocols.models.ChannelAccount :param members: Members to add to the conversation - :type members: list[~microsoft.agents.protocols.models.ChannelAccount] + :type members: list[~microsoft_agents.protocols.models.ChannelAccount] :param topic_name: (Optional) Topic of the conversation (if supported by the channel) :type topic_name: str :param activity: (Optional) When creating a new conversation, use this activity as the initial message to the conversation - :type activity: ~microsoft.agents.protocols.models.Activity + :type activity: ~microsoft_agents.protocols.models.Activity :param channel_data: Channel specific payload for creating the conversation :type channel_data: object diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_reference.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_reference.py similarity index 91% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_reference.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_reference.py index 23aa41fd..d42474fc 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_reference.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_reference.py @@ -17,11 +17,11 @@ class ConversationReference(AgentsModel): :param activity_id: (Optional) ID of the activity to refer to :type activity_id: str :param user: (Optional) User participating in this conversation - :type user: ~microsoft.agents.protocols.models.ChannelAccount + :type user: ~microsoft_agents.protocols.models.ChannelAccount :param agent: Agent participating in this conversation - :type agent: ~microsoft.agents.protocols.models.ChannelAccount + :type agent: ~microsoft_agents.protocols.models.ChannelAccount :param conversation: Conversation reference - :type conversation: ~microsoft.agents.protocols.models.ConversationAccount + :type conversation: ~microsoft_agents.protocols.models.ConversationAccount :param channel_id: Channel ID :type channel_id: str :param locale: A locale name for the contents of the text field. diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_resource_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_resource_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_resource_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_resource_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_update_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_update_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/conversation_update_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/conversation_update_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversations_result.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversations_result.py similarity index 87% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/conversations_result.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/conversations_result.py index 40a8e710..35770b1a 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/conversations_result.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/conversations_result.py @@ -10,7 +10,7 @@ class ConversationsResult(AgentsModel): :type continuation_token: str :param conversations: List of conversations :type conversations: - list[~microsoft.agents.protocols.models.ConversationMembers] + list[~microsoft_agents.protocols.models.ConversationMembers] """ continuation_token: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/delivery_modes.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/delivery_modes.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/delivery_modes.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/delivery_modes.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/end_of_conversation_codes.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/end_of_conversation_codes.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/end_of_conversation_codes.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/end_of_conversation_codes.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/entity.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/entity.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/entity.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/entity.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/error.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/error.py similarity index 88% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/error.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/error.py index 55f4d54a..ad420be2 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/error.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/error.py @@ -11,7 +11,7 @@ class Error(AgentsModel): :param message: Error message :type message: str :param inner_http_error: Error from inner http call - :type inner_http_error: ~microsoft.agents.protocols.models.InnerHttpError + :type inner_http_error: ~microsoft_agents.protocols.models.InnerHttpError """ code: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/error_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/error_response.py similarity index 76% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/error_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/error_response.py index f2506cd8..68f423d6 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/error_response.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/error_response.py @@ -6,7 +6,7 @@ class ErrorResponse(AgentsModel): """An HTTP API response. :param error: Error message - :type error: ~microsoft.agents.protocols.models.Error + :type error: ~microsoft_agents.protocols.models.Error """ error: Error = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/expected_replies.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/expected_replies.py similarity index 81% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/expected_replies.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/expected_replies.py index ad5ae2a7..073afefe 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/expected_replies.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/expected_replies.py @@ -7,7 +7,7 @@ class ExpectedReplies(AgentsModel): :param activities: A collection of Activities that conforms to the ExpectedReplies schema. - :type activities: list[~microsoft.agents.protocols.models.Activity] + :type activities: list[~microsoft_agents.protocols.models.Activity] """ activities: list[Activity] = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/fact.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/fact.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/fact.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/fact.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/geo_coordinates.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/geo_coordinates.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/geo_coordinates.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/geo_coordinates.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/hero_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/hero_card.py similarity index 81% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/hero_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/hero_card.py index ff6c99fc..81468200 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/hero_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/hero_card.py @@ -14,12 +14,12 @@ class HeroCard(AgentsModel): :param text: Text for the card :type text: str :param images: Array of images for the card - :type images: list[~microsoft.agents.protocols.models.CardImage] + :type images: list[~microsoft_agents.protocols.models.CardImage] :param buttons: Set of actions applicable to the current card - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] :param tap: This action will be activated when user taps on the card itself - :type tap: ~microsoft.agents.protocols.models.CardAction + :type tap: ~microsoft_agents.protocols.models.CardAction """ title: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/inner_http_error.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/inner_http_error.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/inner_http_error.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/inner_http_error.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/input_hints.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/input_hints.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/input_hints.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/input_hints.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/installation_update_action_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/installation_update_action_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/installation_update_action_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/installation_update_action_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/invoke_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/invoke_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/invoke_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/invoke_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/media_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/media_card.py similarity index 90% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/media_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/media_card.py index 94c22f7b..12e1196a 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/media_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/media_card.py @@ -15,12 +15,12 @@ class MediaCard(AgentsModel): :param text: Text of this card :type text: str :param image: Thumbnail placeholder - :type image: ~microsoft.agents.protocols.models.ThumbnailUrl + :type image: ~microsoft_agents.protocols.models.ThumbnailUrl :param media: Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. - :type media: list[~microsoft.agents.protocols.models.MediaUrl] + :type media: list[~microsoft_agents.protocols.models.MediaUrl] :param buttons: Actions on this card - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] :param shareable: This content may be shared with others (default:true) :type shareable: bool :param autoloop: Should the client loop playback at end of content diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/media_event_value.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/media_event_value.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/media_event_value.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/media_event_value.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/media_url.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/media_url.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/media_url.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/media_url.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/mention.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/mention.py similarity index 89% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/mention.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/mention.py index d57f6d6b..5d46026a 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/mention.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/mention.py @@ -7,7 +7,7 @@ class Mention(Entity): """Mention information (entity type: "mention"). :param mentioned: The mentioned user - :type mentioned: ~microsoft.agents.protocols.models.ChannelAccount + :type mentioned: ~microsoft_agents.protocols.models.ChannelAccount :param text: Sub Text which represents the mention (can be null or empty) :type text: str :param type: Type of this entity (RFC 3987 IRI) diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/message_reaction.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/message_reaction.py similarity index 81% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/message_reaction.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/message_reaction.py index 158ea94e..84ad5f81 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/message_reaction.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/message_reaction.py @@ -7,7 +7,7 @@ class MessageReaction(AgentsModel): :param type: Message reaction type. Possible values include: 'like', 'plusOne' - :type type: str or ~microsoft.agents.protocols.models.MessageReactionTypes + :type type: str or ~microsoft_agents.protocols.models.MessageReactionTypes """ type: NonEmptyString diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/message_reaction_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/message_reaction_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/message_reaction_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/message_reaction_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/message_update_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/message_update_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/message_update_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/message_update_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/oauth_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/oauth_card.py similarity index 92% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/oauth_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/oauth_card.py index dcf28594..f9aa1262 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/oauth_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/oauth_card.py @@ -14,7 +14,7 @@ class OAuthCard(AgentsModel): :param connection_name: The name of the registered connection :type connection_name: str :param buttons: Action to use to perform signin - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] """ text: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/paged_members_result.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/paged_members_result.py similarity index 86% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/paged_members_result.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/paged_members_result.py index 0718263e..a15f850c 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/paged_members_result.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/paged_members_result.py @@ -9,7 +9,7 @@ class PagedMembersResult(AgentsModel): :param continuation_token: Paging token :type continuation_token: str :param members: The Channel Accounts. - :type members: list[~microsoft.agents.protocols.models.ChannelAccount] + :type members: list[~microsoft_agents.protocols.models.ChannelAccount] """ continuation_token: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/place.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/place.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/place.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/place.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/receipt_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/receipt_card.py similarity index 80% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/receipt_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/receipt_card.py index 17f88214..8110e434 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/receipt_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/receipt_card.py @@ -11,11 +11,11 @@ class ReceiptCard(AgentsModel): :param title: Title of the card :type title: str :param facts: Array of Fact objects - :type facts: list[~microsoft.agents.protocols.models.Fact] + :type facts: list[~microsoft_agents.protocols.models.Fact] :param items: Array of Receipt Items - :type items: list[~microsoft.agents.protocols.models.ReceiptItem] + :type items: list[~microsoft_agents.protocols.models.ReceiptItem] :param tap: This action will be activated when user taps on the card - :type tap: ~microsoft.agents.protocols.models.CardAction + :type tap: ~microsoft_agents.protocols.models.CardAction :param total: Total amount of money paid (or to be paid) :type total: str :param tax: Total amount of tax paid (or to be paid) @@ -23,7 +23,7 @@ class ReceiptCard(AgentsModel): :param vat: Total amount of VAT paid (or to be paid) :type vat: str :param buttons: Set of actions applicable to the current card - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] """ title: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/receipt_item.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/receipt_item.py similarity index 89% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/receipt_item.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/receipt_item.py index 0074cc30..5e794a53 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/receipt_item.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/receipt_item.py @@ -16,14 +16,14 @@ class ReceiptItem(AgentsModel): in font styling only :type text: str :param image: Image - :type image: ~microsoft.agents.protocols.models.CardImage + :type image: ~microsoft_agents.protocols.models.CardImage :param price: Amount with currency :type price: str :param quantity: Number of items of given kind :type quantity: str :param tap: This action will be activated when user taps on the Item bubble. - :type tap: ~microsoft.agents.protocols.models.CardAction + :type tap: ~microsoft_agents.protocols.models.CardAction """ title: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/resource_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/resource_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/resource_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/resource_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/role_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/role_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/role_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/role_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/semantic_action.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/semantic_action.py similarity index 79% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/semantic_action.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/semantic_action.py index bfa846aa..8198dd91 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/semantic_action.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/semantic_action.py @@ -8,9 +8,9 @@ class SemanticAction(AgentsModel): :param id: ID of this action :type id: str :param entities: Entities associated with this action - :type entities: dict[str, ~microsoft.agents.protocols.models.Entity] + :type entities: dict[str, ~microsoft_agents.protocols.models.Entity] :param state: State of this action. Allowed values: `start`, `continue`, `done` - :type state: str or ~microsoft.agents.protocols.models.SemanticActionStates + :type state: str or ~microsoft_agents.protocols.models.SemanticActionStates """ id: NonEmptyString diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/semantic_actions_states.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/semantic_actions_states.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/semantic_actions_states.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/semantic_actions_states.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/sign_in_constants.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/sign_in_constants.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/sign_in_constants.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/sign_in_constants.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/sign_in_resource.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/sign_in_resource.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/sign_in_resource.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/sign_in_resource.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/signin_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/signin_card.py similarity index 86% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/signin_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/signin_card.py index a6396748..f7f12db5 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/signin_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/signin_card.py @@ -9,7 +9,7 @@ class SigninCard(AgentsModel): :param text: Text for signin request :type text: str :param buttons: Action to use to perform signin - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] """ text: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/suggested_actions.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/suggested_actions.py similarity index 89% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/suggested_actions.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/suggested_actions.py index 951c82eb..22f7ed6e 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/suggested_actions.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/suggested_actions.py @@ -11,7 +11,7 @@ class SuggestedActions(AgentsModel): the activity :type to: list[str] :param actions: Actions that can be shown to the user - :type actions: list[~microsoft.agents.protocols.models.CardAction] + :type actions: list[~microsoft_agents.protocols.models.CardAction] """ to: list[NonEmptyString] diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/__init__.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/__init__.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/__init__.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/__init__.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/app_based_link_query.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/app_based_link_query.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/app_based_link_query.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/app_based_link_query.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/batch_failed_entries_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/batch_failed_entries_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/batch_failed_entries_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/batch_failed_entries_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/batch_failed_entry.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/batch_failed_entry.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/batch_failed_entry.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/batch_failed_entry.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/batch_operation_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/batch_operation_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/batch_operation_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/batch_operation_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/batch_operation_state_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/batch_operation_state_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/batch_operation_state_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/batch_operation_state_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/bot_config_auth.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/bot_config_auth.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/bot_config_auth.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/bot_config_auth.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/cache_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/cache_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/cache_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/cache_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/cancel_operation_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/cancel_operation_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/cancel_operation_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/cancel_operation_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/channel_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/channel_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/channel_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/channel_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/config_auth_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/config_auth_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/config_auth_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/config_auth_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/config_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/config_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/config_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/config_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/config_response_base.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/config_response_base.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/config_response_base.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/config_response_base.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/config_task_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/config_task_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/config_task_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/config_task_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/conversation_list.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/conversation_list.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/conversation_list.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/conversation_list.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_consent_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_consent_card.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_consent_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_consent_card.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_consent_card_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_consent_card_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_consent_card_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_consent_card_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_download_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_download_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_download_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_download_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_info_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_info_card.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_info_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_info_card.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_upload_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_upload_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/file_upload_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/file_upload_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_details.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_details.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_details.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_details.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_details_base.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_details_base.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_details_base.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_details_base.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_end_event_details.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_end_event_details.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_end_event_details.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_end_event_details.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_event_details.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_event_details.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_event_details.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_event_details.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification_base.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification_base.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification_base.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification_base.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification_channel_data.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification_channel_data.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification_channel_data.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification_channel_data.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification_recipient_failure_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification_recipient_failure_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification_recipient_failure_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification_recipient_failure_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_notification_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_notification_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_participant_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_participant_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_participant_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_participant_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_participants_event_details.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_participants_event_details.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_participants_event_details.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_participants_event_details.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_stage_surface.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_stage_surface.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_stage_surface.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_stage_surface.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_start_event_details.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_start_event_details.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_start_event_details.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_start_event_details.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_tab_icon_surface.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_tab_icon_surface.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/meeting_tab_icon_surface.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/meeting_tab_icon_surface.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_app.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_app.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_app.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_app.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_attachment.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_attachment.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_attachment.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_attachment.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_body.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_body.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_body.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_body.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_conversation.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_conversation.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_conversation.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_conversation.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_from.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_from.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_from.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_from.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_mention.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_mention.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_mention.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_mention.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_reaction.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_reaction.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_reaction.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_reaction.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_user.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_user.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/message_actions_payload_user.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/message_actions_payload_user.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_action.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_action.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_action.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_action.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_action_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_action_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_action_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_action_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_attachment.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_attachment.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_attachment.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_attachment.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_parameter.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_parameter.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_parameter.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_parameter.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_query.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_query.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_query.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_query.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_query_options.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_query_options.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_query_options.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_query_options.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_result.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_result.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_result.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_result.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_suggested_action.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_suggested_action.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/messaging_extension_suggested_action.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/messaging_extension_suggested_action.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/notification_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/notification_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/notification_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/notification_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_action_base.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_action_base.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_action_base.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_action_base.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_action_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_action_card.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_action_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_action_card.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_action_query.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_action_query.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_action_query.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_action_query.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_date_input.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_date_input.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_date_input.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_date_input.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_fact.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_fact.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_fact.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_fact.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_http_post.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_http_post.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_http_post.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_http_post.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_image.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_image.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_image.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_image.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_input_base.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_input_base.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_input_base.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_input_base.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_multichoice_input.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_multichoice_input.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_multichoice_input.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_multichoice_input.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_multichoice_input_choice.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_multichoice_input_choice.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_multichoice_input_choice.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_multichoice_input_choice.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_open_uri.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_open_uri.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_open_uri.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_open_uri.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_open_uri_target.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_open_uri_target.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_open_uri_target.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_open_uri_target.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_section.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_section.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_section.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_section.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_text_input.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_text_input.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_text_input.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_text_input.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_view_action.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_view_action.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/o365_connector_card_view_action.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/o365_connector_card_view_action.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/on_behalf_of.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/on_behalf_of.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/on_behalf_of.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/on_behalf_of.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/read_receipt_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/read_receipt_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/read_receipt_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/read_receipt_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/signin_state_verification_query.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/signin_state_verification_query.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/signin_state_verification_query.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/signin_state_verification_query.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/surface.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/surface.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/surface.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/surface.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_context.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_context.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_context.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_context.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_entity_context.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_entity_context.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_entity_context.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_entity_context.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_request.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_request.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_request.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_request.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_response_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_response_card.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_response_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_response_card.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_response_cards.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_response_cards.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_response_cards.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_response_cards.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_response_payload.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_response_payload.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_response_payload.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_response_payload.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_submit.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_submit.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_submit.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_submit.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_submit_data.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_submit_data.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_submit_data.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_submit_data.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_suggested_actions.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_suggested_actions.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tab_suggested_actions.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tab_suggested_actions.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/targeted_meeting_notification.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/targeted_meeting_notification.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/targeted_meeting_notification.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/targeted_meeting_notification.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/targeted_meeting_notification_value.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/targeted_meeting_notification_value.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/targeted_meeting_notification_value.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/targeted_meeting_notification_value.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_card_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_card_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_card_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_card_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_continue_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_continue_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_continue_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_continue_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_message_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_message_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_message_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_message_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_request.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_request.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_request.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_request.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_request_context.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_request_context.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_request_context.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_request_context.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_response_base.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_response_base.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_response_base.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_response_base.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_task_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_task_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/task_module_task_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/task_module_task_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/team_details.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/team_details.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/team_details.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/team_details.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/team_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/team_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/team_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/team_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_batch_operation_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_batch_operation_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_batch_operation_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_batch_operation_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_channel_account.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_channel_account.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_channel_account.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_channel_account.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_channel_data.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_channel_data.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_channel_data.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_channel_data.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_channel_data_settings.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_channel_data_settings.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_channel_data_settings.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_channel_data_settings.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_meeting_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_meeting_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_meeting_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_meeting_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_meeting_member.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_meeting_member.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_meeting_member.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_meeting_member.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_meeting_participant.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_meeting_participant.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_meeting_participant.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_meeting_participant.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_member.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_member.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_member.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_member.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_paged_members_result.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_paged_members_result.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/teams_paged_members_result.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/teams_paged_members_result.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tenant_info.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tenant_info.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/tenant_info.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/tenant_info.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/teams/user_meeting_details.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/teams/user_meeting_details.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/teams/user_meeting_details.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/teams/user_meeting_details.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/text_format_types.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/text_format_types.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/text_format_types.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/text_format_types.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/text_highlight.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/text_highlight.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/text_highlight.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/text_highlight.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/thing.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/thing.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/thing.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/thing.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/thumbnail_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/thumbnail_card.py similarity index 81% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/thumbnail_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/thumbnail_card.py index a22bffaa..38051dad 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/thumbnail_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/thumbnail_card.py @@ -14,12 +14,12 @@ class ThumbnailCard(AgentsModel): :param text: Text for the card :type text: str :param images: Array of images for the card - :type images: list[~microsoft.agents.protocols.models.CardImage] + :type images: list[~microsoft_agents.protocols.models.CardImage] :param buttons: Set of actions applicable to the current card - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] :param tap: This action will be activated when user taps on the card itself - :type tap: ~microsoft.agents.protocols.models.CardAction + :type tap: ~microsoft_agents.protocols.models.CardAction """ title: NonEmptyString = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/thumbnail_url.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/thumbnail_url.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/thumbnail_url.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/thumbnail_url.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_invoke_request.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_invoke_request.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_invoke_request.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_invoke_request.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_invoke_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_invoke_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_invoke_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_invoke_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_resource.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_resource.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_resource.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_resource.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_state.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_state.py similarity index 91% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_state.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_state.py index 00efd707..9a5d28c7 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_exchange_state.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_exchange_state.py @@ -14,9 +14,9 @@ class TokenExchangeState(AgentsModel): :param connection_name: The connection name that was used. :type connection_name: str :param conversation: Gets or sets a reference to the conversation. - :type conversation: ~microsoft.agents.protocols.models.ConversationReference + :type conversation: ~microsoft_agents.protocols.models.ConversationReference :param relates_to: Gets or sets a reference to a related parent conversation for this token exchange. - :type relates_to: ~microsoft.agents.protocols.models.ConversationReference + :type relates_to: ~microsoft_agents.protocols.models.ConversationReference :param agent_url: The URL of the agent messaging endpoint. :type agent_url: str :param ms_app_id: The agent's registered application ID. diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_post_resource.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_post_resource.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/token_post_resource.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/token_post_resource.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_request.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_request.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/token_request.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/token_request.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_response.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_response.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/token_response.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/token_response.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/token_status.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/token_status.py similarity index 100% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/token_status.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/token_status.py diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/transcript.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/transcript.py similarity index 80% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/transcript.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/transcript.py index bbcaaf84..be05269f 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/transcript.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/transcript.py @@ -7,7 +7,7 @@ class Transcript(AgentsModel): :param activities: A collection of Activities that conforms to the Transcript schema. - :type activities: list[~microsoft.agents.protocols.models.Activity] + :type activities: list[~microsoft_agents.protocols.models.Activity] """ activities: list[Activity] = None diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/turn_context_protocol.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/turn_context_protocol.py similarity index 97% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/turn_context_protocol.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/turn_context_protocol.py index 7052b377..41703ac6 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/turn_context_protocol.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/turn_context_protocol.py @@ -3,7 +3,7 @@ from typing import Protocol, List, Callable, Optional, Generic, TypeVar from abc import abstractmethod -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, ResourceResponse, ConversationReference, diff --git a/libraries/microsoft-agents-activity/microsoft/agents/activity/video_card.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/video_card.py similarity index 90% rename from libraries/microsoft-agents-activity/microsoft/agents/activity/video_card.py rename to libraries/microsoft-agents-activity/microsoft_agents/activity/video_card.py index ce8f7c57..fcbc5be7 100644 --- a/libraries/microsoft-agents-activity/microsoft/agents/activity/video_card.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/video_card.py @@ -15,12 +15,12 @@ class VideoCard(AgentsModel): :param text: Text of this card :type text: str :param image: Thumbnail placeholder - :type image: ~microsoft.agents.protocols.models.ThumbnailUrl + :type image: ~microsoft_agents.protocols.models.ThumbnailUrl :param media: Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. - :type media: list[~microsoft.agents.protocols.models.MediaUrl] + :type media: list[~microsoft_agents.protocols.models.MediaUrl] :param buttons: Actions on this card - :type buttons: list[~microsoft.agents.protocols.models.CardAction] + :type buttons: list[~microsoft_agents.protocols.models.CardAction] :param shareable: This content may be shared with others (default:true) :type shareable: bool :param autoloop: Should the client loop playback at end of content diff --git a/libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/__init__.py b/libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/__init__.py similarity index 100% rename from libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/__init__.py rename to libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/__init__.py diff --git a/libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/msal_auth.py b/libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_auth.py similarity index 99% rename from libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/msal_auth.py rename to libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_auth.py index 93c1eaf3..eca444dd 100644 --- a/libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/msal_auth.py +++ b/libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_auth.py @@ -14,7 +14,7 @@ from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( AuthTypes, AccessTokenProviderBase, AgentAuthConfiguration, diff --git a/libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/msal_connection_manager.py b/libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_connection_manager.py similarity index 98% rename from libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/msal_connection_manager.py rename to libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_connection_manager.py index 6b2accb8..597f0b1c 100644 --- a/libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/msal_connection_manager.py +++ b/libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_connection_manager.py @@ -1,5 +1,5 @@ from typing import Dict, List, Optional -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( AgentAuthConfiguration, AccessTokenProviderBase, ClaimsIdentity, diff --git a/libraries/microsoft-agents-authentication-msal/tests/test_msal_auth.py b/libraries/microsoft-agents-authentication-msal/tests/test_msal_auth.py index 041f49f9..5edf24d1 100644 --- a/libraries/microsoft-agents-authentication-msal/tests/test_msal_auth.py +++ b/libraries/microsoft-agents-authentication-msal/tests/test_msal_auth.py @@ -2,8 +2,8 @@ from unittest.mock import Mock import pytest from msal import ManagedIdentityClient, ConfidentialClientApplication -from microsoft.agents.authentication.msal import MsalAuth -from microsoft.agents.hosting.core.authorization import AgentAuthConfiguration +from microsoft_agents.authentication.msal import MsalAuth +from microsoft_agents.hosting.core.authorization import AgentAuthConfiguration class TestingMsalAuth(MsalAuth): diff --git a/libraries/microsoft-agents-authentication-msal/tests/test_msal_connection_manager.py b/libraries/microsoft-agents-authentication-msal/tests/test_msal_connection_manager.py index 234796df..723f291a 100644 --- a/libraries/microsoft-agents-authentication-msal/tests/test_msal_connection_manager.py +++ b/libraries/microsoft-agents-authentication-msal/tests/test_msal_connection_manager.py @@ -1,7 +1,7 @@ from os import environ -from microsoft.agents.activity import load_configuration_from_env -from microsoft.agents.hosting.core import AuthTypes -from microsoft.agents.authentication.msal import MsalConnectionManager +from microsoft_agents.activity import load_configuration_from_env +from microsoft_agents.hosting.core import AuthTypes +from microsoft_agents.authentication.msal import MsalConnectionManager class TestMsalConnectionManager: diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/__init__.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/__init__.py similarity index 100% rename from libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/__init__.py rename to libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/__init__.py diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/agent_type.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/agent_type.py similarity index 100% rename from libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/agent_type.py rename to libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/agent_type.py diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/connection_settings.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/connection_settings.py similarity index 100% rename from libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/connection_settings.py rename to libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/connection_settings.py diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/copilot_client.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/copilot_client.py similarity index 98% rename from libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/copilot_client.py rename to libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/copilot_client.py index d162a0c9..a56e99b8 100644 --- a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/copilot_client.py +++ b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/copilot_client.py @@ -1,7 +1,7 @@ import aiohttp from typing import AsyncIterable, Callable, Optional -from microsoft.agents.activity import Activity, ActivityTypes, ConversationAccount +from microsoft_agents.activity import Activity, ActivityTypes, ConversationAccount from .connection_settings import ConnectionSettings from .execute_turn_request import ExecuteTurnRequest diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/direct_to_engine_connection_settings_protocol.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/direct_to_engine_connection_settings_protocol.py similarity index 100% rename from libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/direct_to_engine_connection_settings_protocol.py rename to libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/direct_to_engine_connection_settings_protocol.py diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/execute_turn_request.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/execute_turn_request.py similarity index 52% rename from libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/execute_turn_request.py rename to libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/execute_turn_request.py index 54455dbf..3fc45351 100644 --- a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/execute_turn_request.py +++ b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/execute_turn_request.py @@ -1,4 +1,4 @@ -from microsoft.agents.activity import AgentsModel, Activity +from microsoft_agents.activity import AgentsModel, Activity class ExecuteTurnRequest(AgentsModel): diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/power_platform_cloud.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/power_platform_cloud.py similarity index 100% rename from libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/power_platform_cloud.py rename to libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/power_platform_cloud.py diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/power_platform_environment.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/power_platform_environment.py similarity index 100% rename from libraries/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/power_platform_environment.py rename to libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/power_platform_environment.py diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/__init__.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/__init__.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/__init__.py diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/_start_agent_process.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/_start_agent_process.py similarity index 93% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/_start_agent_process.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/_start_agent_process.py index dd30a73d..0aa93f8b 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/_start_agent_process.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/_start_agent_process.py @@ -1,6 +1,6 @@ from typing import Optional from aiohttp.web import Request, Response -from microsoft.agents.hosting.core.app import AgentApplication +from microsoft_agents.hosting.core.app import AgentApplication from .cloud_adapter import CloudAdapter diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/agent_http_adapter.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/agent_http_adapter.py similarity index 89% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/agent_http_adapter.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/agent_http_adapter.py index c6a5e8d7..a0351aa0 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/agent_http_adapter.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/agent_http_adapter.py @@ -9,7 +9,7 @@ Response, ) -from microsoft.agents.hosting.core import Agent +from microsoft_agents.hosting.core import Agent class AgentHttpAdapter(Protocol): diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/__init__.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/__init__.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/__init__.py diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/__init__.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/__init__.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/__init__.py diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/citation.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/citation.py similarity index 100% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/citation.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/citation.py diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/citation_util.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/citation_util.py similarity index 97% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/citation_util.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/citation_util.py index 00c2c595..1ec923dc 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/citation_util.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/citation_util.py @@ -4,7 +4,7 @@ import re from typing import List, Optional -from microsoft.agents.activity import ClientCitation +from microsoft_agents.activity import ClientCitation class CitationUtil: diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/streaming_response.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py similarity index 99% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/streaming_response.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py index be6e5cc8..ef01e870 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/streaming_response.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py @@ -6,7 +6,7 @@ from typing import List, Optional, Callable, Literal, TYPE_CHECKING from dataclasses import dataclass -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, Entity, Attachment, @@ -18,7 +18,7 @@ ) if TYPE_CHECKING: - from microsoft.agents.hosting.core.turn_context import TurnContext + from microsoft_agents.hosting.core.turn_context import TurnContext from .citation import Citation from .citation_util import CitationUtil diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/channel_service_route_table.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/channel_service_route_table.py similarity index 98% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/channel_service_route_table.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/channel_service_route_table.py index 6f7c536e..4a8a193b 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/channel_service_route_table.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/channel_service_route_table.py @@ -5,14 +5,14 @@ from aiohttp.web import RouteTableDef, Request, Response -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( AgentsModel, Activity, AttachmentData, ConversationParameters, Transcript, ) -from microsoft.agents.hosting.core import ChannelApiHandlerProtocol +from microsoft_agents.hosting.core import ChannelApiHandlerProtocol async def deserialize_from_body( diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/cloud_adapter.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/cloud_adapter.py similarity index 96% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/cloud_adapter.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/cloud_adapter.py index c47d99fe..e80014bf 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/cloud_adapter.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/cloud_adapter.py @@ -12,15 +12,15 @@ HTTPUnauthorized, HTTPUnsupportedMediaType, ) -from microsoft.agents.hosting.core.authorization import ( +from microsoft_agents.hosting.core.authorization import ( ClaimsIdentity, Connections, ) -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, DeliveryModes, ) -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( Agent, ChannelServiceAdapter, ChannelServiceClientFactoryBase, diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/jwt_authorization_middleware.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/jwt_authorization_middleware.py similarity index 97% rename from libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/jwt_authorization_middleware.py rename to libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/jwt_authorization_middleware.py index e0be82d2..5accb9f7 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/jwt_authorization_middleware.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/jwt_authorization_middleware.py @@ -1,7 +1,7 @@ import functools from aiohttp.web import Request, middleware, json_response -from microsoft.agents.hosting.core.authorization import ( +from microsoft_agents.hosting.core.authorization import ( AgentAuthConfiguration, JwtTokenValidator, ) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/activity_handler.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/activity_handler.py similarity index 94% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/activity_handler.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/activity_handler.py index 96a949d4..50e9db11 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/activity_handler.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/activity_handler.py @@ -4,8 +4,8 @@ from http import HTTPStatus from pydantic import BaseModel -from microsoft.agents.activity import TurnContextProtocol -from microsoft.agents.activity import ( +from microsoft_agents.activity import TurnContextProtocol +from microsoft_agents.activity import ( Activity, ActivityTypes, AdaptiveCardInvokeResponse, @@ -37,7 +37,7 @@ async def on_turn( in order to process an inbound :class:`hosting.schema.Activity`. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -105,7 +105,7 @@ async def on_message_activity( # pylint: disable=unused-argument such as the conversational logic. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ @@ -119,7 +119,7 @@ async def on_message_update_activity( # pylint: disable=unused-argument such as the conversational logic. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ @@ -133,7 +133,7 @@ async def on_message_delete_activity( # pylint: disable=unused-argument such as the conversational logic. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ @@ -145,7 +145,7 @@ async def on_conversation_update_activity(self, turn_context: TurnContextProtoco :meth:`on_turn()` is used. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -181,7 +181,7 @@ async def on_members_added_activity( conversation update activity :type members_added: :class:`typing.List` :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -203,7 +203,7 @@ async def on_members_removed_activity( conversation update activity :type members_added: :class:`typing.List` :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -221,7 +221,7 @@ async def on_message_reaction_activity(self, turn_context: TurnContextProtocol): :meth:`on_turn()` is used. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -267,7 +267,7 @@ async def on_reactions_added( # pylint: disable=unused-argument :param message_reactions: The list of reactions added :type message_reactions: :class:`typing.List` :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -293,7 +293,7 @@ async def on_reactions_removed( # pylint: disable=unused-argument :param message_reactions: The list of reactions removed :type message_reactions: :class:`typing.List` :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -312,7 +312,7 @@ async def on_event_activity(self, turn_context: TurnContextProtocol): :meth:`on_turn()` is used. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -343,7 +343,7 @@ async def on_token_response_event( # pylint: disable=unused-argument If using an `oauth_prompt`, override this method to forward this activity to the current dialog. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -363,7 +363,7 @@ async def on_event( # pylint: disable=unused-argument :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -381,7 +381,7 @@ async def on_end_of_conversation_activity( # pylint: disable=unused-argument Invoked when a conversation end activity is received from the channel. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ return @@ -394,7 +394,7 @@ async def on_typing_activity( # pylint: disable=unused-argument ActivityTypes.typing activities, such as the conversational logic. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ return @@ -407,7 +407,7 @@ async def on_installation_update( # pylint: disable=unused-argument ActivityTypes.InstallationUpdate activities. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ if turn_context.activity.action in ("add", "add-upgrade"): @@ -424,7 +424,7 @@ async def on_installation_update_add( # pylint: disable=unused-argument ActivityTypes.InstallationUpdate activities with 'action' set to 'add'. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ return @@ -437,7 +437,7 @@ async def on_installation_update_remove( # pylint: disable=unused-argument ActivityTypes.InstallationUpdate activities with 'action' set to 'remove'. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ return @@ -451,7 +451,7 @@ async def on_unrecognized_activity_type( # pylint: disable=unused-argument If overridden, this method could potentially respond to any of the other activity types. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute @@ -468,7 +468,7 @@ async def on_invoke_activity( # pylint: disable=unused-argument Registers an activity event handler for the _invoke_ event, emitted for every incoming event activity. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ @@ -504,7 +504,7 @@ async def on_sign_in_invoke( # pylint: disable=unused-argument By default, this method does nothing. :param turn_context: The context object for this turn - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :returns: A task that represents the work queued to execute """ @@ -520,9 +520,9 @@ async def on_adaptive_card_invoke( calls this method. :param turn_context: A context object for this turn. - :type turn_context: :class:`microsoft.agents.builder.TurnContext` + :type turn_context: :class:`microsoft_agents.builder.TurnContext` :param invoke_value: A string-typed object from the incoming activity's value. - :type invoke_value: :class:`microsoft.agents.activity.models.AdaptiveCardInvokeValue` + :type invoke_value: :class:`microsoft_agents.activity.models.AdaptiveCardInvokeValue` :return: The HealthCheckResponse object """ raise _InvokeResponseException(HTTPStatus.NOT_IMPLEMENTED) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/agent.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/agent.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/agent.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/agent.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/agent_application.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/agent_application.py similarity index 96% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/agent_application.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/agent_application.py index 6084a36c..a379c35c 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/agent_application.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/agent_application.py @@ -1,897 +1,897 @@ -""" -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the MIT License. -""" - -from __future__ import annotations -import logging -from copy import copy -from functools import partial - -import re -from typing import ( - Any, - Awaitable, - Callable, - Dict, - Generic, - List, - Optional, - Pattern, - TypeVar, - Union, - cast, -) - -from microsoft.agents.hosting.core.authorization import Connections - -from microsoft.agents.hosting.core import Agent, TurnContext -from microsoft.agents.activity import ( - Activity, - ActivityTypes, - ActionTypes, - ConversationUpdateTypes, - MessageReactionTypes, - MessageUpdateTypes, - InvokeResponse, - TokenResponse, - OAuthCard, - Attachment, - CardAction, -) - -from .. import CardFactory, MessageFactory -from .app_error import ApplicationError -from .app_options import ApplicationOptions - -# from .auth import AuthManager, OAuth, OAuthOptions -from .route import Route, RouteHandler -from .state import TurnState -from ..channel_service_adapter import ChannelServiceAdapter -from ..oauth import ( - FlowResponse, - FlowState, - FlowStateTag, -) -from .oauth import Authorization -from .typing_indicator import TypingIndicator - -logger = logging.getLogger(__name__) - -StateT = TypeVar("StateT", bound=TurnState) -IN_SIGN_IN_KEY = "__InSignInFlow__" - - -class AgentApplication(Agent, Generic[StateT]): - """ - AgentApplication class for routing and processing incoming requests. - - The AgentApplication object replaces the traditional ActivityHandler that - a bot would use. It supports a simpler fluent style of authoring bots - versus the inheritance based approach used by the ActivityHandler class. - - Additionally, it has built-in support for calling into the SDK's AI system - and can be used to create bots that leverage Large Language Models (LLM) - and other AI capabilities. - """ - - typing: TypingIndicator - - _options: ApplicationOptions - _adapter: Optional[ChannelServiceAdapter] = None - _auth: Optional[Authorization] = None - _internal_before_turn: List[Callable[[TurnContext, StateT], Awaitable[bool]]] = [] - _internal_after_turn: List[Callable[[TurnContext, StateT], Awaitable[bool]]] = [] - _routes: List[Route[StateT]] = [] - _error: Optional[Callable[[TurnContext, Exception], Awaitable[None]]] = None - _turn_state_factory: Optional[Callable[[TurnContext], StateT]] = None - - def __init__( - self, - options: ApplicationOptions = None, - *, - connection_manager: Connections = None, - authorization: Authorization = None, - **kwargs, - ) -> None: - """ - Creates a new AgentApplication instance. - """ - self.typing = TypingIndicator() - self._routes = [] - - configuration = kwargs - - logger.debug(f"Initializing AgentApplication with options: {options}") - logger.debug( - f"Initializing AgentApplication with configuration: {configuration}" - ) - - if not options: - # TODO: consolidate configuration story - # Take the options from the kwargs and create an ApplicationOptions instance - option_kwargs = dict( - filter( - lambda x: x[0] in ApplicationOptions.__dataclass_fields__, - kwargs.items(), - ) - ) - options = ApplicationOptions(**option_kwargs) - - self._options = options - - if not self._options.storage: - logger.error( - "ApplicationOptions.storage is required and was not configured.", - stack_info=True, - ) - raise ApplicationError( - """ - The `ApplicationOptions.storage` property is required and was not configured. - """ - ) - - if options.long_running_messages and ( - not options.adapter or not options.bot_app_id - ): - logger.error( - "ApplicationOptions.long_running_messages requires an adapter and bot_app_id.", - stack_info=True, - ) - raise ApplicationError( - """ - The `ApplicationOptions.long_running_messages` property is unavailable because - no adapter or `bot_app_id` was configured. - """ - ) - - if options.adapter: - self._adapter = options.adapter - - self._turn_state_factory = ( - options.turn_state_factory - or kwargs.get("turn_state_factory", None) - or partial(TurnState.with_storage, self._options.storage) - ) - - # TODO: decide how to initialize the Authorization (params vs options vs kwargs) - if authorization: - self._auth = authorization - else: - auth_options = { - key: value - for key, value in configuration.items() - if key not in ["storage", "connection_manager", "handlers"] - } - self._auth = Authorization( - storage=self._options.storage, - connection_manager=connection_manager, - handlers=options.authorization_handlers, - **auth_options, - ) - - @property - def adapter(self) -> ChannelServiceAdapter: - """ - The bot's adapter. - """ - - if not self._adapter: - logger.error( - "AgentApplication.adapter(): self._adapter is not configured.", - stack_info=True, - ) - raise ApplicationError( - """ - The AgentApplication.adapter property is unavailable because it was - not configured when creating the AgentApplication. - """ - ) - - return self._adapter - - @property - def auth(self): - """ - The application's authentication manager - """ - if not self._auth: - logger.error( - "AgentApplication.auth(): self._auth is not configured.", - stack_info=True, - ) - raise ApplicationError( - """ - The `AgentApplication.auth` property is unavailable because - no Auth options were configured. - """ - ) - - return self._auth - - @property - def options(self) -> ApplicationOptions: - """ - The application's configured options. - """ - return self._options - - def activity( - self, - activity_type: Union[str, ActivityTypes, List[Union[str, ActivityTypes]]], - *, - auth_handlers: Optional[List[str]] = None, - ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: - """ - Registers a new activity event listener. This method can be used as either - a decorator or a method. - - ```python - # Use this method as a decorator - @app.activity("event") - async def on_event(context: TurnContext, state: TurnState): - print("hello world!") - return True - ``` - - #### Args: - - `type`: The type of the activity - """ - - def __selector(context: TurnContext): - return activity_type == context.activity.type - - def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: - logger.debug( - f"Registering activity handler for route handler {func.__name__} with type: {activity_type} with auth handlers: {auth_handlers}" - ) - self._routes.append( - Route[StateT](__selector, func, auth_handlers=auth_handlers) - ) - return func - - return __call - - def message( - self, - select: Union[str, Pattern[str], List[Union[str, Pattern[str]]]], - *, - auth_handlers: Optional[List[str]] = None, - ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: - """ - Registers a new message activity event listener. This method can be used as either - a decorator or a method. - - ```python - # Use this method as a decorator - @app.message("hi") - async def on_hi_message(context: TurnContext, state: TurnState): - print("hello!") - return True - - #### Args: - - `select`: a string or regex pattern - """ - - def __selector(context: TurnContext): - if context.activity.type != ActivityTypes.message: - return False - - text = context.activity.text if context.activity.text else "" - if isinstance(select, Pattern): - hits = re.fullmatch(select, text) - return hits is not None - - return text == select - - def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: - logger.debug( - f"Registering message handler for route handler {func.__name__} with select: {select} with auth handlers: {auth_handlers}" - ) - self._routes.append( - Route[StateT](__selector, func, auth_handlers=auth_handlers) - ) - return func - - return __call - - def conversation_update( - self, - type: ConversationUpdateTypes, - *, - auth_handlers: Optional[List[str]] = None, - ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: - """ - Registers a new message activity event listener. This method can be used as either - a decorator or a method. - - ```python - # Use this method as a decorator - @app.conversation_update("channelCreated") - async def on_channel_created(context: TurnContext, state: TurnState): - print("a new channel was created!") - return True - - ``` - - #### Args: - - `type`: a string or regex pattern - """ - - def __selector(context: TurnContext): - if context.activity.type != ActivityTypes.conversation_update: - return False - - if type == "membersAdded": - if isinstance(context.activity.members_added, List): - return len(context.activity.members_added) > 0 - return False - - if type == "membersRemoved": - if isinstance(context.activity.members_removed, List): - return len(context.activity.members_removed) > 0 - return False - - if isinstance(context.activity.channel_data, object): - data = vars(context.activity.channel_data) - return data["event_type"] == type - - return False - - def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: - logger.debug( - f"Registering conversation update handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}" - ) - self._routes.append( - Route[StateT](__selector, func, auth_handlers=auth_handlers) - ) - return func - - return __call - - def message_reaction( - self, type: MessageReactionTypes, *, auth_handlers: Optional[List[str]] = None - ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: - """ - Registers a new message activity event listener. This method can be used as either - a decorator or a method. - - ```python - # Use this method as a decorator - @app.message_reaction("reactionsAdded") - async def on_reactions_added(context: TurnContext, state: TurnState): - print("reactions was added!") - return True - ``` - - #### Args: - - `type`: a string or regex pattern - """ - - def __selector(context: TurnContext): - if context.activity.type != ActivityTypes.message_reaction: - return False - - if type == "reactionsAdded": - if isinstance(context.activity.reactions_added, List): - return len(context.activity.reactions_added) > 0 - return False - - if type == "reactionsRemoved": - if isinstance(context.activity.reactions_removed, List): - return len(context.activity.reactions_removed) > 0 - return False - - return False - - def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: - logger.debug( - f"Registering message reaction handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}" - ) - self._routes.append( - Route[StateT](__selector, func, auth_handlers=auth_handlers) - ) - return func - - return __call - - def message_update( - self, type: MessageUpdateTypes, *, auth_handlers: Optional[List[str]] = None - ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: - """ - Registers a new message activity event listener. This method can be used as either - a decorator or a method. - - ```python - # Use this method as a decorator - @app.message_update("editMessage") - async def on_edit_message(context: TurnContext, state: TurnState): - print("message was edited!") - return True - ``` - - #### Args: - - `type`: a string or regex pattern - """ - - def __selector(context: TurnContext): - if type == "editMessage": - if ( - context.activity.type == ActivityTypes.message_update - and isinstance(context.activity.channel_data, dict) - ): - data = context.activity.channel_data - return data["event_type"] == type - return False - - if type == "softDeleteMessage": - if ( - context.activity.type == ActivityTypes.message_delete - and isinstance(context.activity.channel_data, dict) - ): - data = context.activity.channel_data - return data["event_type"] == type - return False - - if type == "undeleteMessage": - if ( - context.activity.type == ActivityTypes.message_update - and isinstance(context.activity.channel_data, dict) - ): - data = context.activity.channel_data - return data["event_type"] == type - return False - return False - - def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: - logger.debug( - f"Registering message update handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}" - ) - self._routes.append( - Route[StateT](__selector, func, auth_handlers=auth_handlers) - ) - return func - - return __call - - def handoff(self, *, auth_handlers: Optional[List[str]] = None) -> Callable[ - [Callable[[TurnContext, StateT, str], Awaitable[None]]], - Callable[[TurnContext, StateT, str], Awaitable[None]], - ]: - """ - Registers a handler to handoff conversations from one copilot to another. - ```python - # Use this method as a decorator - @app.handoff - async def on_handoff( - context: TurnContext, state: TurnState, continuation: str - ): - print(query) - ``` - """ - - def __selector(context: TurnContext) -> bool: - return ( - context.activity.type == ActivityTypes.invoke - and context.activity.name == "handoff/action" - ) - - def __call( - func: Callable[[TurnContext, StateT, str], Awaitable[None]], - ) -> Callable[[TurnContext, StateT, str], Awaitable[None]]: - async def __handler(context: TurnContext, state: StateT): - if not context.activity.value: - return False - await func(context, state, context.activity.value["continuation"]) - await context.send_activity( - Activity( - type=ActivityTypes.invoke_response, - value=InvokeResponse(status=200), - ) - ) - return True - - logger.debug( - f"Registering handoff handler for route handler {func.__name__} with auth handlers: {auth_handlers}" - ) - - self._routes.append( - Route[StateT](__selector, __handler, True, auth_handlers) - ) - self._routes = sorted(self._routes, key=lambda route: not route.is_invoke) - return func - - return __call - - def on_sign_in_success( - self, func: Callable[[TurnContext, StateT, Optional[str]], Awaitable[None]] - ) -> Callable[[TurnContext, StateT, Optional[str]], Awaitable[None]]: - """ - Registers a new event listener that will be executed when a user successfully signs in. - - ```python - # Use this method as a decorator - @app.on_sign_in_success - async def sign_in_success(context: TurnContext, state: TurnState): - print("hello world!") - return True - ``` - """ - - if self._auth: - logger.debug( - f"Registering sign-in success handler for route handler {func.__name__}" - ) - self._auth.on_sign_in_success(func) - else: - logger.error( - f"Failed to register sign-in success handler for route handler {func.__name__}", - stack_info=True, - ) - raise ApplicationError( - """ - The `AgentApplication.on_sign_in_success` method is unavailable because - no Auth options were configured. - """ - ) - return func - - def on_sign_in_failure( - self, func: Callable[[TurnContext, StateT, Optional[str]], Awaitable[None]] - ) -> Callable[[TurnContext, StateT, Optional[str]], Awaitable[None]]: - """ - Registers a new event listener that will be executed when a user fails to sign in. - - ```python - # Use this method as a decorator - @app.on_sign_in_failure - async def sign_in_failure(context: TurnContext, state: TurnState): - print("hello world!") - return True - ``` - """ - - if self._auth: - logger.debug( - f"Registering sign-in failure handler for route handler {func.__name__}" - ) - self._auth.on_sign_in_failure(func) - else: - logger.error( - f"Failed to register sign-in failure handler for route handler {func.__name__}", - stack_info=True, - ) - raise ApplicationError( - """ - The `AgentApplication.on_sign_in_failure` method is unavailable because - no Auth options were configured. - """ - ) - return func - - def error( - self, func: Callable[[TurnContext, Exception], Awaitable[None]] - ) -> Callable[[TurnContext, Exception], Awaitable[None]]: - """ - Registers an error handler that will be called anytime - the app throws an Exception - - ```python - # Use this method as a decorator - @app.error - async def on_error(context: TurnContext, err: Exception): - print(err.message) - ``` - """ - - logger.debug(f"Registering the error handler {func.__name__} ") - self._error = func - - if self._adapter: - logger.debug( - f"Registering for adapter {self._adapter.__class__.__name__} the error handler {func.__name__} " - ) - self._adapter.on_turn_error = func - - return func - - def turn_state_factory(self, func: Callable[[TurnContext], Awaitable[StateT]]): - """ - Custom Turn State Factory - """ - logger.debug(f"Setting custom turn state factory: {func.__name__}") - self._turn_state_factory = func - return func - - async def _handle_flow_response( - self, context: TurnContext, flow_response: FlowResponse - ) -> None: - """Handles CONTINUE and FAILURE flow responses, sending activities back.""" - flow_state: FlowState = flow_response.flow_state - - if flow_state.tag == FlowStateTag.BEGIN: - # Create the OAuth card - sign_in_resource = flow_response.sign_in_resource - o_card: Attachment = CardFactory.oauth_card( - OAuthCard( - text="Sign in", - connection_name=flow_state.connection, - buttons=[ - CardAction( - title="Sign in", - type=ActionTypes.signin, - value=sign_in_resource.sign_in_link, - channel_data=None, - ) - ], - token_exchange_resource=sign_in_resource.token_exchange_resource, - token_post_resource=sign_in_resource.token_post_resource, - ) - ) - # Send the card to the user - await context.send_activity(MessageFactory.attachment(o_card)) - elif flow_state.tag == FlowStateTag.FAILURE: - if flow_state.reached_max_attempts(): - await context.send_activity( - MessageFactory.text( - "Sign-in failed. Max retries reached. Please try again later." - ) - ) - elif flow_state.is_expired(): - await context.send_activity( - MessageFactory.text("Sign-in session expired. Please try again.") - ) - else: - logger.warning("Sign-in flow failed for unknown reasons.") - await context.send_activity("Sign-in failed. Please try again.") - - async def _on_turn_auth_intercept( - self, context: TurnContext, turn_state: TurnState - ) -> bool: - """Intercepts the turn to check for active authentication flows.""" - logger.debug( - "Checking for active sign-in flow for context: %s with activity type %s", - context.activity.id, - context.activity.type, - ) - prev_flow_state = await self._auth.get_active_flow_state(context) - if prev_flow_state: - logger.debug( - "Previous flow state: %s", - { - "user_id": prev_flow_state.user_id, - "connection": prev_flow_state.connection, - "channel_id": prev_flow_state.channel_id, - "auth_handler_id": prev_flow_state.auth_handler_id, - "tag": prev_flow_state.tag, - "expiration": prev_flow_state.expiration, - }, - ) - # proceed if there is an existing flow to continue - # new flows should be initiated in _on_activity - # this can be reorganized later... but it works for now - if ( - prev_flow_state - and ( - prev_flow_state.tag == FlowStateTag.NOT_STARTED - or prev_flow_state.is_active() - ) - and context.activity.type in [ActivityTypes.message, ActivityTypes.invoke] - ): - - logger.debug("Sign-in flow is active for context: %s", context.activity.id) - - flow_response: FlowResponse = await self._auth.begin_or_continue_flow( - context, turn_state, prev_flow_state.auth_handler_id - ) - - await self._handle_flow_response(context, flow_response) - - new_flow_state: FlowState = flow_response.flow_state - token_response: TokenResponse = flow_response.token_response - saved_activity: Activity = new_flow_state.continuation_activity.model_copy() - - if token_response: - new_context = copy(context) - new_context.activity = saved_activity - logger.info("Resending continuation activity %s", saved_activity.text) - await self.on_turn(new_context) - await turn_state.save(context) - return True # early return from _on_turn - return False # continue _on_turn - - async def on_turn(self, context: TurnContext): - logger.debug( - f"AgentApplication.on_turn(): Processing turn for context: {context.activity.id}" - ) - await self._start_long_running_call(context, self._on_turn) - - async def _on_turn(self, context: TurnContext): - # robrandao: TODO - try: - await self._start_typing(context) - - self._remove_mentions(context) - - logger.debug("Initializing turn state") - turn_state = await self._initialize_state(context) - - if self._auth and await self._on_turn_auth_intercept(context, turn_state): - return - - logger.debug("Running before turn middleware") - if not await self._run_before_turn_middleware(context, turn_state): - return - - logger.debug("Running file downloads") - await self._handle_file_downloads(context, turn_state) - - logger.debug("Running activity handlers") - await self._on_activity(context, turn_state) - - logger.debug("Running after turn middleware") - if not await self._run_after_turn_middleware(context, turn_state): - await turn_state.save(context) - return - except ApplicationError as err: - logger.error( - f"An application error occurred in the AgentApplication: {err}", - exc_info=True, - ) - await self._on_error(context, err) - finally: - self.typing.stop() - - async def _start_typing(self, context: TurnContext): - if self._options.start_typing_timer: - await self.typing.start(context) - - def _remove_mentions(self, context: TurnContext): - if ( - self.options.remove_recipient_mention - and context.activity.type == ActivityTypes.message - ): - context.activity.text = context.remove_recipient_mention(context.activity) - - @staticmethod - def parse_env_vars_configuration(vars: Dict[str, Any]) -> dict: - """ - Parses environment variables and returns a dictionary with the relevant configuration. - """ - result = {} - for key, value in vars.items(): - levels = key.split("__") - current_level = result - last_level = None - for next_level in levels: - if next_level not in current_level: - current_level[next_level] = {} - last_level = current_level - current_level = current_level[next_level] - logger.debug(f"Using environment variable '{key}'") - last_level[levels[-1]] = value - - return { - "AGENT_APPLICATION": result["AGENT_APPLICATION"], - "COPILOT_STUDIO_AGENT": result["COPILOT_STUDIO_AGENT"], - "CONNECTIONS": result["CONNECTIONS"], - "CONNECTIONS_MAP": result["CONNECTIONS_MAP"], - } - - async def _initialize_state(self, context: TurnContext) -> StateT: - if self._turn_state_factory: - logger.debug("Using custom turn state factory") - turn_state = self._turn_state_factory() - else: - logger.debug("Using default turn state factory") - turn_state = TurnState.with_storage(self._options.storage) - await turn_state.load(context, self._options.storage) - - turn_state = cast(StateT, turn_state) - - logger.debug("Loading turn state from storage") - await turn_state.load(context, self._options.storage) - turn_state.temp.input = context.activity.text - return turn_state - - async def _run_before_turn_middleware(self, context: TurnContext, state: StateT): - for before_turn in self._internal_before_turn: - is_ok = await before_turn(context, state) - if not is_ok: - await state.save(context, self._options.storage) - return False - return True - - async def _handle_file_downloads(self, context: TurnContext, state: StateT): - if self._options.file_downloaders and len(self._options.file_downloaders) > 0: - input_files = state.temp.input_files if state.temp.input_files else [] - for file_downloader in self._options.file_downloaders: - logger.info( - f"Using file downloader: {file_downloader.__class__.__name__}" - ) - files = await file_downloader.download_files(context) - input_files.extend(files) - state.temp.input_files = input_files - - def _contains_non_text_attachments(self, context: TurnContext): - non_text_attachments = filter( - lambda a: not a.content_type.startswith("text/html"), - context.activity.attachments, - ) - return len(list(non_text_attachments)) > 0 - - async def _run_after_turn_middleware(self, context: TurnContext, state: StateT): - for after_turn in self._internal_after_turn: - is_ok = await after_turn(context, state) - if not is_ok: - await state.save(context, self._options.storage) - return False - return True - - async def _on_activity(self, context: TurnContext, state: StateT): - for route in self._routes: - if route.selector(context): - if not route.auth_handlers: - await route.handler(context, state) - else: - sign_in_complete = False - for auth_handler_id in route.auth_handlers: - logger.debug( - "Beginning or continuing flow for auth handler %s", - auth_handler_id, - ) - flow_response: FlowResponse = ( - await self._auth.begin_or_continue_flow( - context, state, auth_handler_id - ) - ) - await self._handle_flow_response(context, flow_response) - logger.debug( - "Flow response flow_state.tag: %s", - flow_response.flow_state.tag, - ) - sign_in_complete = ( - flow_response.flow_state.tag == FlowStateTag.COMPLETE - ) - if not sign_in_complete: - break - - if sign_in_complete: - await route.handler(context, state) - return - logger.warning( - f"No route found for activity type: {context.activity.type} with text: {context.activity.text}" - ) - - async def _start_long_running_call( - self, context: TurnContext, func: Callable[[TurnContext], Awaitable] - ): - if ( - self._adapter - and ActivityTypes.message == context.activity.type - and self._options.long_running_messages - ): - logger.debug( - f"Starting long running call for context: {context.activity.id} with function: {func.__name__}" - ) - return await self._adapter.continue_conversation( - reference=context.get_conversation_reference(context.activity), - callback=func, - bot_app_id=self.options.bot_app_id, - ) - - return await func(context) - - async def _on_error(self, context: TurnContext, err: ApplicationError) -> None: - if self._error: - logger.info( - f"Calling error handler {self._error.__name__} for error: {err}" - ) - return await self._error(context, err) - - logger.error( - f"An error occurred in the AgentApplication: {err}", - exc_info=True, - ) - logger.error(err) - raise err +""" +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the MIT License. +""" + +from __future__ import annotations +import logging +from copy import copy +from functools import partial + +import re +from typing import ( + Any, + Awaitable, + Callable, + Dict, + Generic, + List, + Optional, + Pattern, + TypeVar, + Union, + cast, +) + +from microsoft_agents.hosting.core.authorization import Connections + +from microsoft_agents.hosting.core import Agent, TurnContext +from microsoft_agents.activity import ( + Activity, + ActivityTypes, + ActionTypes, + ConversationUpdateTypes, + MessageReactionTypes, + MessageUpdateTypes, + InvokeResponse, + TokenResponse, + OAuthCard, + Attachment, + CardAction, +) + +from .. import CardFactory, MessageFactory +from .app_error import ApplicationError +from .app_options import ApplicationOptions + +# from .auth import AuthManager, OAuth, OAuthOptions +from .route import Route, RouteHandler +from .state import TurnState +from ..channel_service_adapter import ChannelServiceAdapter +from ..oauth import ( + FlowResponse, + FlowState, + FlowStateTag, +) +from .oauth import Authorization +from .typing_indicator import TypingIndicator + +logger = logging.getLogger(__name__) + +StateT = TypeVar("StateT", bound=TurnState) +IN_SIGN_IN_KEY = "__InSignInFlow__" + + +class AgentApplication(Agent, Generic[StateT]): + """ + AgentApplication class for routing and processing incoming requests. + + The AgentApplication object replaces the traditional ActivityHandler that + a bot would use. It supports a simpler fluent style of authoring bots + versus the inheritance based approach used by the ActivityHandler class. + + Additionally, it has built-in support for calling into the SDK's AI system + and can be used to create bots that leverage Large Language Models (LLM) + and other AI capabilities. + """ + + typing: TypingIndicator + + _options: ApplicationOptions + _adapter: Optional[ChannelServiceAdapter] = None + _auth: Optional[Authorization] = None + _internal_before_turn: List[Callable[[TurnContext, StateT], Awaitable[bool]]] = [] + _internal_after_turn: List[Callable[[TurnContext, StateT], Awaitable[bool]]] = [] + _routes: List[Route[StateT]] = [] + _error: Optional[Callable[[TurnContext, Exception], Awaitable[None]]] = None + _turn_state_factory: Optional[Callable[[TurnContext], StateT]] = None + + def __init__( + self, + options: ApplicationOptions = None, + *, + connection_manager: Connections = None, + authorization: Authorization = None, + **kwargs, + ) -> None: + """ + Creates a new AgentApplication instance. + """ + self.typing = TypingIndicator() + self._routes = [] + + configuration = kwargs + + logger.debug(f"Initializing AgentApplication with options: {options}") + logger.debug( + f"Initializing AgentApplication with configuration: {configuration}" + ) + + if not options: + # TODO: consolidate configuration story + # Take the options from the kwargs and create an ApplicationOptions instance + option_kwargs = dict( + filter( + lambda x: x[0] in ApplicationOptions.__dataclass_fields__, + kwargs.items(), + ) + ) + options = ApplicationOptions(**option_kwargs) + + self._options = options + + if not self._options.storage: + logger.error( + "ApplicationOptions.storage is required and was not configured.", + stack_info=True, + ) + raise ApplicationError( + """ + The `ApplicationOptions.storage` property is required and was not configured. + """ + ) + + if options.long_running_messages and ( + not options.adapter or not options.bot_app_id + ): + logger.error( + "ApplicationOptions.long_running_messages requires an adapter and bot_app_id.", + stack_info=True, + ) + raise ApplicationError( + """ + The `ApplicationOptions.long_running_messages` property is unavailable because + no adapter or `bot_app_id` was configured. + """ + ) + + if options.adapter: + self._adapter = options.adapter + + self._turn_state_factory = ( + options.turn_state_factory + or kwargs.get("turn_state_factory", None) + or partial(TurnState.with_storage, self._options.storage) + ) + + # TODO: decide how to initialize the Authorization (params vs options vs kwargs) + if authorization: + self._auth = authorization + else: + auth_options = { + key: value + for key, value in configuration.items() + if key not in ["storage", "connection_manager", "handlers"] + } + self._auth = Authorization( + storage=self._options.storage, + connection_manager=connection_manager, + handlers=options.authorization_handlers, + **auth_options, + ) + + @property + def adapter(self) -> ChannelServiceAdapter: + """ + The bot's adapter. + """ + + if not self._adapter: + logger.error( + "AgentApplication.adapter(): self._adapter is not configured.", + stack_info=True, + ) + raise ApplicationError( + """ + The AgentApplication.adapter property is unavailable because it was + not configured when creating the AgentApplication. + """ + ) + + return self._adapter + + @property + def auth(self): + """ + The application's authentication manager + """ + if not self._auth: + logger.error( + "AgentApplication.auth(): self._auth is not configured.", + stack_info=True, + ) + raise ApplicationError( + """ + The `AgentApplication.auth` property is unavailable because + no Auth options were configured. + """ + ) + + return self._auth + + @property + def options(self) -> ApplicationOptions: + """ + The application's configured options. + """ + return self._options + + def activity( + self, + activity_type: Union[str, ActivityTypes, List[Union[str, ActivityTypes]]], + *, + auth_handlers: Optional[List[str]] = None, + ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: + """ + Registers a new activity event listener. This method can be used as either + a decorator or a method. + + ```python + # Use this method as a decorator + @app.activity("event") + async def on_event(context: TurnContext, state: TurnState): + print("hello world!") + return True + ``` + + #### Args: + - `type`: The type of the activity + """ + + def __selector(context: TurnContext): + return activity_type == context.activity.type + + def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: + logger.debug( + f"Registering activity handler for route handler {func.__name__} with type: {activity_type} with auth handlers: {auth_handlers}" + ) + self._routes.append( + Route[StateT](__selector, func, auth_handlers=auth_handlers) + ) + return func + + return __call + + def message( + self, + select: Union[str, Pattern[str], List[Union[str, Pattern[str]]]], + *, + auth_handlers: Optional[List[str]] = None, + ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: + """ + Registers a new message activity event listener. This method can be used as either + a decorator or a method. + + ```python + # Use this method as a decorator + @app.message("hi") + async def on_hi_message(context: TurnContext, state: TurnState): + print("hello!") + return True + + #### Args: + - `select`: a string or regex pattern + """ + + def __selector(context: TurnContext): + if context.activity.type != ActivityTypes.message: + return False + + text = context.activity.text if context.activity.text else "" + if isinstance(select, Pattern): + hits = re.fullmatch(select, text) + return hits is not None + + return text == select + + def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: + logger.debug( + f"Registering message handler for route handler {func.__name__} with select: {select} with auth handlers: {auth_handlers}" + ) + self._routes.append( + Route[StateT](__selector, func, auth_handlers=auth_handlers) + ) + return func + + return __call + + def conversation_update( + self, + type: ConversationUpdateTypes, + *, + auth_handlers: Optional[List[str]] = None, + ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: + """ + Registers a new message activity event listener. This method can be used as either + a decorator or a method. + + ```python + # Use this method as a decorator + @app.conversation_update("channelCreated") + async def on_channel_created(context: TurnContext, state: TurnState): + print("a new channel was created!") + return True + + ``` + + #### Args: + - `type`: a string or regex pattern + """ + + def __selector(context: TurnContext): + if context.activity.type != ActivityTypes.conversation_update: + return False + + if type == "membersAdded": + if isinstance(context.activity.members_added, List): + return len(context.activity.members_added) > 0 + return False + + if type == "membersRemoved": + if isinstance(context.activity.members_removed, List): + return len(context.activity.members_removed) > 0 + return False + + if isinstance(context.activity.channel_data, object): + data = vars(context.activity.channel_data) + return data["event_type"] == type + + return False + + def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: + logger.debug( + f"Registering conversation update handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}" + ) + self._routes.append( + Route[StateT](__selector, func, auth_handlers=auth_handlers) + ) + return func + + return __call + + def message_reaction( + self, type: MessageReactionTypes, *, auth_handlers: Optional[List[str]] = None + ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: + """ + Registers a new message activity event listener. This method can be used as either + a decorator or a method. + + ```python + # Use this method as a decorator + @app.message_reaction("reactionsAdded") + async def on_reactions_added(context: TurnContext, state: TurnState): + print("reactions was added!") + return True + ``` + + #### Args: + - `type`: a string or regex pattern + """ + + def __selector(context: TurnContext): + if context.activity.type != ActivityTypes.message_reaction: + return False + + if type == "reactionsAdded": + if isinstance(context.activity.reactions_added, List): + return len(context.activity.reactions_added) > 0 + return False + + if type == "reactionsRemoved": + if isinstance(context.activity.reactions_removed, List): + return len(context.activity.reactions_removed) > 0 + return False + + return False + + def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: + logger.debug( + f"Registering message reaction handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}" + ) + self._routes.append( + Route[StateT](__selector, func, auth_handlers=auth_handlers) + ) + return func + + return __call + + def message_update( + self, type: MessageUpdateTypes, *, auth_handlers: Optional[List[str]] = None + ) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]: + """ + Registers a new message activity event listener. This method can be used as either + a decorator or a method. + + ```python + # Use this method as a decorator + @app.message_update("editMessage") + async def on_edit_message(context: TurnContext, state: TurnState): + print("message was edited!") + return True + ``` + + #### Args: + - `type`: a string or regex pattern + """ + + def __selector(context: TurnContext): + if type == "editMessage": + if ( + context.activity.type == ActivityTypes.message_update + and isinstance(context.activity.channel_data, dict) + ): + data = context.activity.channel_data + return data["event_type"] == type + return False + + if type == "softDeleteMessage": + if ( + context.activity.type == ActivityTypes.message_delete + and isinstance(context.activity.channel_data, dict) + ): + data = context.activity.channel_data + return data["event_type"] == type + return False + + if type == "undeleteMessage": + if ( + context.activity.type == ActivityTypes.message_update + and isinstance(context.activity.channel_data, dict) + ): + data = context.activity.channel_data + return data["event_type"] == type + return False + return False + + def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]: + logger.debug( + f"Registering message update handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}" + ) + self._routes.append( + Route[StateT](__selector, func, auth_handlers=auth_handlers) + ) + return func + + return __call + + def handoff(self, *, auth_handlers: Optional[List[str]] = None) -> Callable[ + [Callable[[TurnContext, StateT, str], Awaitable[None]]], + Callable[[TurnContext, StateT, str], Awaitable[None]], + ]: + """ + Registers a handler to handoff conversations from one copilot to another. + ```python + # Use this method as a decorator + @app.handoff + async def on_handoff( + context: TurnContext, state: TurnState, continuation: str + ): + print(query) + ``` + """ + + def __selector(context: TurnContext) -> bool: + return ( + context.activity.type == ActivityTypes.invoke + and context.activity.name == "handoff/action" + ) + + def __call( + func: Callable[[TurnContext, StateT, str], Awaitable[None]], + ) -> Callable[[TurnContext, StateT, str], Awaitable[None]]: + async def __handler(context: TurnContext, state: StateT): + if not context.activity.value: + return False + await func(context, state, context.activity.value["continuation"]) + await context.send_activity( + Activity( + type=ActivityTypes.invoke_response, + value=InvokeResponse(status=200), + ) + ) + return True + + logger.debug( + f"Registering handoff handler for route handler {func.__name__} with auth handlers: {auth_handlers}" + ) + + self._routes.append( + Route[StateT](__selector, __handler, True, auth_handlers) + ) + self._routes = sorted(self._routes, key=lambda route: not route.is_invoke) + return func + + return __call + + def on_sign_in_success( + self, func: Callable[[TurnContext, StateT, Optional[str]], Awaitable[None]] + ) -> Callable[[TurnContext, StateT, Optional[str]], Awaitable[None]]: + """ + Registers a new event listener that will be executed when a user successfully signs in. + + ```python + # Use this method as a decorator + @app.on_sign_in_success + async def sign_in_success(context: TurnContext, state: TurnState): + print("hello world!") + return True + ``` + """ + + if self._auth: + logger.debug( + f"Registering sign-in success handler for route handler {func.__name__}" + ) + self._auth.on_sign_in_success(func) + else: + logger.error( + f"Failed to register sign-in success handler for route handler {func.__name__}", + stack_info=True, + ) + raise ApplicationError( + """ + The `AgentApplication.on_sign_in_success` method is unavailable because + no Auth options were configured. + """ + ) + return func + + def on_sign_in_failure( + self, func: Callable[[TurnContext, StateT, Optional[str]], Awaitable[None]] + ) -> Callable[[TurnContext, StateT, Optional[str]], Awaitable[None]]: + """ + Registers a new event listener that will be executed when a user fails to sign in. + + ```python + # Use this method as a decorator + @app.on_sign_in_failure + async def sign_in_failure(context: TurnContext, state: TurnState): + print("hello world!") + return True + ``` + """ + + if self._auth: + logger.debug( + f"Registering sign-in failure handler for route handler {func.__name__}" + ) + self._auth.on_sign_in_failure(func) + else: + logger.error( + f"Failed to register sign-in failure handler for route handler {func.__name__}", + stack_info=True, + ) + raise ApplicationError( + """ + The `AgentApplication.on_sign_in_failure` method is unavailable because + no Auth options were configured. + """ + ) + return func + + def error( + self, func: Callable[[TurnContext, Exception], Awaitable[None]] + ) -> Callable[[TurnContext, Exception], Awaitable[None]]: + """ + Registers an error handler that will be called anytime + the app throws an Exception + + ```python + # Use this method as a decorator + @app.error + async def on_error(context: TurnContext, err: Exception): + print(err.message) + ``` + """ + + logger.debug(f"Registering the error handler {func.__name__} ") + self._error = func + + if self._adapter: + logger.debug( + f"Registering for adapter {self._adapter.__class__.__name__} the error handler {func.__name__} " + ) + self._adapter.on_turn_error = func + + return func + + def turn_state_factory(self, func: Callable[[TurnContext], Awaitable[StateT]]): + """ + Custom Turn State Factory + """ + logger.debug(f"Setting custom turn state factory: {func.__name__}") + self._turn_state_factory = func + return func + + async def _handle_flow_response( + self, context: TurnContext, flow_response: FlowResponse + ) -> None: + """Handles CONTINUE and FAILURE flow responses, sending activities back.""" + flow_state: FlowState = flow_response.flow_state + + if flow_state.tag == FlowStateTag.BEGIN: + # Create the OAuth card + sign_in_resource = flow_response.sign_in_resource + o_card: Attachment = CardFactory.oauth_card( + OAuthCard( + text="Sign in", + connection_name=flow_state.connection, + buttons=[ + CardAction( + title="Sign in", + type=ActionTypes.signin, + value=sign_in_resource.sign_in_link, + channel_data=None, + ) + ], + token_exchange_resource=sign_in_resource.token_exchange_resource, + token_post_resource=sign_in_resource.token_post_resource, + ) + ) + # Send the card to the user + await context.send_activity(MessageFactory.attachment(o_card)) + elif flow_state.tag == FlowStateTag.FAILURE: + if flow_state.reached_max_attempts(): + await context.send_activity( + MessageFactory.text( + "Sign-in failed. Max retries reached. Please try again later." + ) + ) + elif flow_state.is_expired(): + await context.send_activity( + MessageFactory.text("Sign-in session expired. Please try again.") + ) + else: + logger.warning("Sign-in flow failed for unknown reasons.") + await context.send_activity("Sign-in failed. Please try again.") + + async def _on_turn_auth_intercept( + self, context: TurnContext, turn_state: TurnState + ) -> bool: + """Intercepts the turn to check for active authentication flows.""" + logger.debug( + "Checking for active sign-in flow for context: %s with activity type %s", + context.activity.id, + context.activity.type, + ) + prev_flow_state = await self._auth.get_active_flow_state(context) + if prev_flow_state: + logger.debug( + "Previous flow state: %s", + { + "user_id": prev_flow_state.user_id, + "connection": prev_flow_state.connection, + "channel_id": prev_flow_state.channel_id, + "auth_handler_id": prev_flow_state.auth_handler_id, + "tag": prev_flow_state.tag, + "expiration": prev_flow_state.expiration, + }, + ) + # proceed if there is an existing flow to continue + # new flows should be initiated in _on_activity + # this can be reorganized later... but it works for now + if ( + prev_flow_state + and ( + prev_flow_state.tag == FlowStateTag.NOT_STARTED + or prev_flow_state.is_active() + ) + and context.activity.type in [ActivityTypes.message, ActivityTypes.invoke] + ): + + logger.debug("Sign-in flow is active for context: %s", context.activity.id) + + flow_response: FlowResponse = await self._auth.begin_or_continue_flow( + context, turn_state, prev_flow_state.auth_handler_id + ) + + await self._handle_flow_response(context, flow_response) + + new_flow_state: FlowState = flow_response.flow_state + token_response: TokenResponse = flow_response.token_response + saved_activity: Activity = new_flow_state.continuation_activity.model_copy() + + if token_response: + new_context = copy(context) + new_context.activity = saved_activity + logger.info("Resending continuation activity %s", saved_activity.text) + await self.on_turn(new_context) + await turn_state.save(context) + return True # early return from _on_turn + return False # continue _on_turn + + async def on_turn(self, context: TurnContext): + logger.debug( + f"AgentApplication.on_turn(): Processing turn for context: {context.activity.id}" + ) + await self._start_long_running_call(context, self._on_turn) + + async def _on_turn(self, context: TurnContext): + # robrandao: TODO + try: + await self._start_typing(context) + + self._remove_mentions(context) + + logger.debug("Initializing turn state") + turn_state = await self._initialize_state(context) + + if self._auth and await self._on_turn_auth_intercept(context, turn_state): + return + + logger.debug("Running before turn middleware") + if not await self._run_before_turn_middleware(context, turn_state): + return + + logger.debug("Running file downloads") + await self._handle_file_downloads(context, turn_state) + + logger.debug("Running activity handlers") + await self._on_activity(context, turn_state) + + logger.debug("Running after turn middleware") + if not await self._run_after_turn_middleware(context, turn_state): + await turn_state.save(context) + return + except ApplicationError as err: + logger.error( + f"An application error occurred in the AgentApplication: {err}", + exc_info=True, + ) + await self._on_error(context, err) + finally: + self.typing.stop() + + async def _start_typing(self, context: TurnContext): + if self._options.start_typing_timer: + await self.typing.start(context) + + def _remove_mentions(self, context: TurnContext): + if ( + self.options.remove_recipient_mention + and context.activity.type == ActivityTypes.message + ): + context.activity.text = context.remove_recipient_mention(context.activity) + + @staticmethod + def parse_env_vars_configuration(vars: Dict[str, Any]) -> dict: + """ + Parses environment variables and returns a dictionary with the relevant configuration. + """ + result = {} + for key, value in vars.items(): + levels = key.split("__") + current_level = result + last_level = None + for next_level in levels: + if next_level not in current_level: + current_level[next_level] = {} + last_level = current_level + current_level = current_level[next_level] + logger.debug(f"Using environment variable '{key}'") + last_level[levels[-1]] = value + + return { + "AGENT_APPLICATION": result["AGENT_APPLICATION"], + "COPILOT_STUDIO_AGENT": result["COPILOT_STUDIO_AGENT"], + "CONNECTIONS": result["CONNECTIONS"], + "CONNECTIONS_MAP": result["CONNECTIONS_MAP"], + } + + async def _initialize_state(self, context: TurnContext) -> StateT: + if self._turn_state_factory: + logger.debug("Using custom turn state factory") + turn_state = self._turn_state_factory() + else: + logger.debug("Using default turn state factory") + turn_state = TurnState.with_storage(self._options.storage) + await turn_state.load(context, self._options.storage) + + turn_state = cast(StateT, turn_state) + + logger.debug("Loading turn state from storage") + await turn_state.load(context, self._options.storage) + turn_state.temp.input = context.activity.text + return turn_state + + async def _run_before_turn_middleware(self, context: TurnContext, state: StateT): + for before_turn in self._internal_before_turn: + is_ok = await before_turn(context, state) + if not is_ok: + await state.save(context, self._options.storage) + return False + return True + + async def _handle_file_downloads(self, context: TurnContext, state: StateT): + if self._options.file_downloaders and len(self._options.file_downloaders) > 0: + input_files = state.temp.input_files if state.temp.input_files else [] + for file_downloader in self._options.file_downloaders: + logger.info( + f"Using file downloader: {file_downloader.__class__.__name__}" + ) + files = await file_downloader.download_files(context) + input_files.extend(files) + state.temp.input_files = input_files + + def _contains_non_text_attachments(self, context: TurnContext): + non_text_attachments = filter( + lambda a: not a.content_type.startswith("text/html"), + context.activity.attachments, + ) + return len(list(non_text_attachments)) > 0 + + async def _run_after_turn_middleware(self, context: TurnContext, state: StateT): + for after_turn in self._internal_after_turn: + is_ok = await after_turn(context, state) + if not is_ok: + await state.save(context, self._options.storage) + return False + return True + + async def _on_activity(self, context: TurnContext, state: StateT): + for route in self._routes: + if route.selector(context): + if not route.auth_handlers: + await route.handler(context, state) + else: + sign_in_complete = False + for auth_handler_id in route.auth_handlers: + logger.debug( + "Beginning or continuing flow for auth handler %s", + auth_handler_id, + ) + flow_response: FlowResponse = ( + await self._auth.begin_or_continue_flow( + context, state, auth_handler_id + ) + ) + await self._handle_flow_response(context, flow_response) + logger.debug( + "Flow response flow_state.tag: %s", + flow_response.flow_state.tag, + ) + sign_in_complete = ( + flow_response.flow_state.tag == FlowStateTag.COMPLETE + ) + if not sign_in_complete: + break + + if sign_in_complete: + await route.handler(context, state) + return + logger.warning( + f"No route found for activity type: {context.activity.type} with text: {context.activity.text}" + ) + + async def _start_long_running_call( + self, context: TurnContext, func: Callable[[TurnContext], Awaitable] + ): + if ( + self._adapter + and ActivityTypes.message == context.activity.type + and self._options.long_running_messages + ): + logger.debug( + f"Starting long running call for context: {context.activity.id} with function: {func.__name__}" + ) + return await self._adapter.continue_conversation( + reference=context.get_conversation_reference(context.activity), + callback=func, + bot_app_id=self.options.bot_app_id, + ) + + return await func(context) + + async def _on_error(self, context: TurnContext, err: ApplicationError) -> None: + if self._error: + logger.info( + f"Calling error handler {self._error.__name__} for error: {err}" + ) + return await self._error(context, err) + + logger.error( + f"An error occurred in the AgentApplication: {err}", + exc_info=True, + ) + logger.error(err) + raise err diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/app_error.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/app_error.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/app_error.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/app_error.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/app_options.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/app_options.py similarity index 95% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/app_options.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/app_options.py index e0d871de..21312c76 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/app_options.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/app_options.py @@ -9,8 +9,8 @@ from logging import Logger from typing import Callable, List, Optional -from microsoft.agents.hosting.core.app.oauth import AuthHandler -from microsoft.agents.hosting.core.storage import Storage +from microsoft_agents.hosting.core.app.oauth import AuthHandler +from microsoft_agents.hosting.core.storage import Storage # from .auth import AuthOptions from .input_file import InputFileDownloader diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/input_file.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/input_file.py similarity index 95% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/input_file.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/input_file.py index 859cdeec..49c1cf70 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/input_file.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/input_file.py @@ -9,7 +9,7 @@ from dataclasses import dataclass from typing import List, Optional -from microsoft.agents.hosting.core import TurnContext +from microsoft_agents.hosting.core import TurnContext @dataclass diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/auth_handler.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/auth_handler.py similarity index 96% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/auth_handler.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/auth_handler.py index ddde6e9a..bce68789 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/auth_handler.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/auth_handler.py @@ -1,48 +1,48 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -import logging -from typing import Dict - -logger = logging.getLogger(__name__) - - -class AuthHandler: - """ - Interface defining an authorization handler for OAuth flows. - """ - - def __init__( - self, - name: str = None, - title: str = None, - text: str = None, - abs_oauth_connection_name: str = None, - obo_connection_name: str = None, - **kwargs, - ): - """ - Initializes a new instance of AuthHandler. - - Args: - name: The name of the OAuth connection. - auto: Whether to automatically start the OAuth flow. - title: Title for the OAuth card. - text: Text for the OAuth button. - """ - self.name = name or kwargs.get("NAME") - self.title = title or kwargs.get("TITLE") - self.text = text or kwargs.get("TEXT") - self.abs_oauth_connection_name = abs_oauth_connection_name or kwargs.get( - "AZUREBOTOAUTHCONNECTIONNAME" - ) - self.obo_connection_name = obo_connection_name or kwargs.get( - "OBOCONNECTIONNAME" - ) - logger.debug( - f"AuthHandler initialized: name={self.name}, title={self.title}, text={self.text} abs_connection_name={self.abs_oauth_connection_name} obo_connection_name={self.obo_connection_name}" - ) - - -# # Type alias for authorization handlers dictionary -AuthorizationHandlers = Dict[str, AuthHandler] +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import logging +from typing import Dict + +logger = logging.getLogger(__name__) + + +class AuthHandler: + """ + Interface defining an authorization handler for OAuth flows. + """ + + def __init__( + self, + name: str = None, + title: str = None, + text: str = None, + abs_oauth_connection_name: str = None, + obo_connection_name: str = None, + **kwargs, + ): + """ + Initializes a new instance of AuthHandler. + + Args: + name: The name of the OAuth connection. + auto: Whether to automatically start the OAuth flow. + title: Title for the OAuth card. + text: Text for the OAuth button. + """ + self.name = name or kwargs.get("NAME") + self.title = title or kwargs.get("TITLE") + self.text = text or kwargs.get("TEXT") + self.abs_oauth_connection_name = abs_oauth_connection_name or kwargs.get( + "AZUREBOTOAUTHCONNECTIONNAME" + ) + self.obo_connection_name = obo_connection_name or kwargs.get( + "OBOCONNECTIONNAME" + ) + logger.debug( + f"AuthHandler initialized: name={self.name}, title={self.title}, text={self.text} abs_connection_name={self.abs_oauth_connection_name} obo_connection_name={self.obo_connection_name}" + ) + + +# # Type alias for authorization handlers dictionary +AuthorizationHandlers = Dict[str, AuthHandler] diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/authorization.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/authorization.py similarity index 95% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/authorization.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/authorization.py index 145ac895..8ef635f0 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/oauth/authorization.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/authorization.py @@ -1,398 +1,398 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -from __future__ import annotations -import logging -import jwt -from typing import Dict, Optional, Callable, Awaitable, AsyncIterator -from collections.abc import Iterable -from contextlib import asynccontextmanager - -from microsoft.agents.hosting.core.authorization import ( - Connections, - AccessTokenProviderBase, -) -from microsoft.agents.hosting.core.storage import Storage, MemoryStorage -from microsoft.agents.activity import TokenResponse -from microsoft.agents.hosting.core.connector.client import UserTokenClient - -from ...turn_context import TurnContext -from ...oauth import OAuthFlow, FlowResponse, FlowState, FlowStateTag, FlowStorageClient -from ..state.turn_state import TurnState -from .auth_handler import AuthHandler - -logger = logging.getLogger(__name__) - - -class Authorization: - """ - Class responsible for managing authorization and OAuth flows. - Handles multiple OAuth providers and manages the complete authentication lifecycle. - """ - - def __init__( - self, - storage: Storage, - connection_manager: Connections, - auth_handlers: dict[str, AuthHandler] = None, - auto_signin: bool = None, - use_cache: bool = False, - **kwargs, - ): - """ - Creates a new instance of Authorization. - - Args: - storage: The storage system to use for state management. - auth_handlers: Configuration for OAuth providers. - - Raises: - ValueError: If storage is None or no auth handlers are provided. - """ - if not storage: - raise ValueError("Storage is required for Authorization") - - self._storage = storage - self._connection_manager = connection_manager - - auth_configuration: Dict = kwargs.get("AGENTAPPLICATION", {}).get( - "USERAUTHORIZATION", {} - ) - - handlers_config: Dict[str, Dict] = auth_configuration.get("HANDLERS") - if not auth_handlers and handlers_config: - auth_handlers = { - handler_name: AuthHandler( - name=handler_name, **config.get("SETTINGS", {}) - ) - for handler_name, config in handlers_config.items() - } - - self._auth_handlers = auth_handlers or {} - self._sign_in_success_handler: Optional[ - Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]] - ] = lambda *args: None - self._sign_in_failure_handler: Optional[ - Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]] - ] = lambda *args: None - - def _ids_from_context(self, context: TurnContext) -> tuple[str, str]: - """Checks and returns IDs necessary to load a new or existing flow. - - Raises a ValueError if channel ID or user ID are missing. - """ - if ( - not context.activity.channel_id - or not context.activity.from_property - or not context.activity.from_property.id - ): - raise ValueError("Channel ID and User ID are required") - - return context.activity.channel_id, context.activity.from_property.id - - async def _load_flow( - self, context: TurnContext, auth_handler_id: str = "" - ) -> tuple[OAuthFlow, FlowStorageClient]: - """Loads the OAuth flow for a specific auth handler. - - Args: - context: The context object for the current turn. - auth_handler_id: The ID of the auth handler to use. - - Returns: - The OAuthFlow returned corresponds to the flow associated with the - chosen handler, and the channel and user info found in the context. - The FlowStorageClient corresponds to the same channel and user info. - """ - user_token_client: UserTokenClient = context.turn_state.get( - context.adapter.USER_TOKEN_CLIENT_KEY - ) - - # resolve handler id - auth_handler: AuthHandler = self.resolve_handler(auth_handler_id) - auth_handler_id = auth_handler.name - - channel_id, user_id = self._ids_from_context(context) - - ms_app_id = context.turn_state.get(context.adapter.AGENT_IDENTITY_KEY).claims[ - "aud" - ] - - # try to load existing state - flow_storage_client = FlowStorageClient(channel_id, user_id, self._storage) - logger.info("Loading OAuth flow state from storage") - flow_state: FlowState = await flow_storage_client.read(auth_handler_id) - - if not flow_state: - logger.info("No existing flow state found, creating new flow state") - flow_state = FlowState( - channel_id=channel_id, - user_id=user_id, - auth_handler_id=auth_handler_id, - connection=auth_handler.abs_oauth_connection_name, - ms_app_id=ms_app_id, - ) - await flow_storage_client.write(flow_state) - - flow = OAuthFlow(flow_state, user_token_client) - return flow, flow_storage_client - - @asynccontextmanager - async def open_flow( - self, context: TurnContext, auth_handler_id: str = "" - ) -> AsyncIterator[OAuthFlow]: - """Loads an OAuth flow and saves changes the changes to storage if any are made. - - Args: - context: The context object for the current turn. - auth_handler_id: ID of the auth handler to use. - If none provided, uses the first handler. - - Yields: - OAuthFlow: - The OAuthFlow instance loaded from storage or newly created - if not yet present in storage. - """ - if not context: - logger.error("No context provided to open_flow") - raise ValueError("context is required") - - flow, flow_storage_client = await self._load_flow(context, auth_handler_id) - yield flow - logger.info("Saving OAuth flow state to storage") - await flow_storage_client.write(flow.flow_state) - - async def get_token( - self, context: TurnContext, auth_handler_id: str - ) -> TokenResponse: - """ - Gets the token for a specific auth handler. - - Args: - context: The context object for the current turn. - auth_handler_id: Optional ID of the auth handler to use, defaults to first handler. - - Returns: - The token response from the OAuth provider. - """ - logger.info("Getting token for auth handler: %s", auth_handler_id) - async with self.open_flow(context, auth_handler_id) as flow: - return await flow.get_user_token() - - async def exchange_token( - self, - context: TurnContext, - scopes: list[str], - auth_handler_id: Optional[str] = None, - ) -> TokenResponse: - """ - Exchanges a token for another token with different scopes. - - Args: - context: The context object for the current turn. - scopes: The scopes to request for the new token. - auth_handler_id: Optional ID of the auth handler to use, defaults to first handler. - - Returns: - The token response from the OAuth provider. - """ - logger.info("Exchanging token for scopes: %s", scopes) - async with self.open_flow(context, auth_handler_id) as flow: - token_response = await flow.get_user_token() - - if token_response and self._is_exchangeable(token_response.token): - logger.debug("Token is exchangeable, performing OBO flow") - return await self._handle_obo(token_response.token, scopes, auth_handler_id) - - return TokenResponse() - - def _is_exchangeable(self, token: str) -> bool: - """ - Checks if a token is exchangeable (has api:// audience). - - Args: - token: The token to check. - - Returns: - True if the token is exchangeable, False otherwise. - """ - try: - # Decode without verification to check the audience - payload = jwt.decode(token, options={"verify_signature": False}) - aud = payload.get("aud") - return isinstance(aud, str) and aud.startswith("api://") - except Exception: - logger.error("Failed to decode token to check audience") - return False - - async def _handle_obo( - self, token: str, scopes: list[str], handler_id: str = None - ) -> TokenResponse: - """ - Handles On-Behalf-Of token exchange. - - Args: - context: The context object for the current turn. - token: The original token. - scopes: The scopes to request. - - Returns: - The new token response. - - """ - auth_handler = self.resolve_handler(handler_id) - token_provider: AccessTokenProviderBase = ( - self._connection_manager.get_connection(auth_handler.obo_connection_name) - ) - - logger.info("Attempting to exchange token on behalf of user") - new_token = await token_provider.aquire_token_on_behalf_of( - scopes=scopes, - user_assertion=token, - ) - return TokenResponse( - token=new_token, - scopes=scopes, # Expiration can be set based on the token provider's response - ) - - async def get_active_flow_state(self, context: TurnContext) -> Optional[FlowState]: - """Gets the first active flow state for the current context.""" - logger.debug("Getting active flow state") - channel_id, user_id = self._ids_from_context(context) - flow_storage_client = FlowStorageClient(channel_id, user_id, self._storage) - for auth_handler_id in self._auth_handlers.keys(): - flow_state = await flow_storage_client.read(auth_handler_id) - if flow_state and flow_state.is_active(): - return flow_state - return None - - async def begin_or_continue_flow( - self, - context: TurnContext, - turn_state: TurnState, - auth_handler_id: str = "", - ) -> FlowResponse: - """Begins or continues an OAuth flow. - - Args: - context: The context object for the current turn. - turn_state: The state object for the current turn. - auth_handler_id: Optional ID of the auth handler to use, defaults to first handler. - - Returns: - The token response from the OAuth provider. - - """ - if not auth_handler_id: - auth_handler_id = self.resolve_handler().name - - logger.debug("Beginning or continuing OAuth flow") - async with self.open_flow(context, auth_handler_id) as flow: - prev_tag = flow.flow_state.tag - flow_response: FlowResponse = await flow.begin_or_continue_flow( - context.activity - ) - - flow_state: FlowState = flow_response.flow_state - - if ( - flow_state.tag == FlowStateTag.COMPLETE - and prev_tag != FlowStateTag.COMPLETE - ): - logger.debug("Calling Authorization sign in success handler") - self._sign_in_success_handler( - context, turn_state, flow_state.auth_handler_id - ) - elif flow_state.tag == FlowStateTag.FAILURE: - logger.debug("Calling Authorization sign in failure handler") - self._sign_in_failure_handler( - context, - turn_state, - flow_state.auth_handler_id, - flow_response.flow_error_tag, - ) - - return flow_response - - def resolve_handler(self, auth_handler_id: Optional[str] = None) -> AuthHandler: - """Resolves the auth handler to use based on the provided ID. - - Args: - auth_handler_id: Optional ID of the auth handler to resolve, defaults to first handler. - - Returns: - The resolved auth handler. - """ - if auth_handler_id: - if auth_handler_id not in self._auth_handlers: - logger.error("Auth handler '%s' not found", auth_handler_id) - raise ValueError(f"Auth handler '{auth_handler_id}' not found") - return self._auth_handlers[auth_handler_id] - - # Return the first handler if no ID specified - return next(iter(self._auth_handlers.values())) - - async def _sign_out( - self, - context: TurnContext, - auth_handler_ids: Iterable[str], - ) -> None: - """Signs out from the specified auth handlers. - - Args: - context: The context object for the current turn. - auth_handler_ids: Iterable of auth handler IDs to sign out from. - - Deletes the associated flow states from storage. - """ - for auth_handler_id in auth_handler_ids: - flow, flow_storage_client = await self._load_flow(context, auth_handler_id) - # ensure that the id is valid - self.resolve_handler(auth_handler_id) - logger.info("Signing out from handler: %s", auth_handler_id) - await flow.sign_out() - await flow_storage_client.delete(auth_handler_id) - - async def sign_out( - self, - context: TurnContext, - auth_handler_id: Optional[str] = None, - ) -> None: - """ - Signs out the current user. - This method clears the user's token and resets the OAuth state. - - Args: - context: The context object for the current turn. - auth_handler_id: Optional ID of the auth handler to use for sign out. If None, - signs out from all the handlers. - - Deletes the associated flow state(s) from storage. - """ - if auth_handler_id: - await self._sign_out(context, [auth_handler_id]) - else: - await self._sign_out(context, self._auth_handlers.keys()) - - def on_sign_in_success( - self, - handler: Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]], - ) -> None: - """ - Sets a handler to be called when sign-in is successfully completed. - - Args: - handler: The handler function to call on successful sign-in. - """ - self._sign_in_success_handler = handler - - def on_sign_in_failure( - self, - handler: Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]], - ) -> None: - """ - Sets a handler to be called when sign-in fails. - Args: - handler: The handler function to call on sign-in failure. - """ - self._sign_in_failure_handler = handler +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +from __future__ import annotations +import logging +import jwt +from typing import Dict, Optional, Callable, Awaitable, AsyncIterator +from collections.abc import Iterable +from contextlib import asynccontextmanager + +from microsoft_agents.hosting.core.authorization import ( + Connections, + AccessTokenProviderBase, +) +from microsoft_agents.hosting.core.storage import Storage, MemoryStorage +from microsoft_agents.activity import TokenResponse +from microsoft_agents.hosting.core.connector.client import UserTokenClient + +from ...turn_context import TurnContext +from ...oauth import OAuthFlow, FlowResponse, FlowState, FlowStateTag, FlowStorageClient +from ..state.turn_state import TurnState +from .auth_handler import AuthHandler + +logger = logging.getLogger(__name__) + + +class Authorization: + """ + Class responsible for managing authorization and OAuth flows. + Handles multiple OAuth providers and manages the complete authentication lifecycle. + """ + + def __init__( + self, + storage: Storage, + connection_manager: Connections, + auth_handlers: dict[str, AuthHandler] = None, + auto_signin: bool = None, + use_cache: bool = False, + **kwargs, + ): + """ + Creates a new instance of Authorization. + + Args: + storage: The storage system to use for state management. + auth_handlers: Configuration for OAuth providers. + + Raises: + ValueError: If storage is None or no auth handlers are provided. + """ + if not storage: + raise ValueError("Storage is required for Authorization") + + self._storage = storage + self._connection_manager = connection_manager + + auth_configuration: Dict = kwargs.get("AGENTAPPLICATION", {}).get( + "USERAUTHORIZATION", {} + ) + + handlers_config: Dict[str, Dict] = auth_configuration.get("HANDLERS") + if not auth_handlers and handlers_config: + auth_handlers = { + handler_name: AuthHandler( + name=handler_name, **config.get("SETTINGS", {}) + ) + for handler_name, config in handlers_config.items() + } + + self._auth_handlers = auth_handlers or {} + self._sign_in_success_handler: Optional[ + Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]] + ] = lambda *args: None + self._sign_in_failure_handler: Optional[ + Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]] + ] = lambda *args: None + + def _ids_from_context(self, context: TurnContext) -> tuple[str, str]: + """Checks and returns IDs necessary to load a new or existing flow. + + Raises a ValueError if channel ID or user ID are missing. + """ + if ( + not context.activity.channel_id + or not context.activity.from_property + or not context.activity.from_property.id + ): + raise ValueError("Channel ID and User ID are required") + + return context.activity.channel_id, context.activity.from_property.id + + async def _load_flow( + self, context: TurnContext, auth_handler_id: str = "" + ) -> tuple[OAuthFlow, FlowStorageClient]: + """Loads the OAuth flow for a specific auth handler. + + Args: + context: The context object for the current turn. + auth_handler_id: The ID of the auth handler to use. + + Returns: + The OAuthFlow returned corresponds to the flow associated with the + chosen handler, and the channel and user info found in the context. + The FlowStorageClient corresponds to the same channel and user info. + """ + user_token_client: UserTokenClient = context.turn_state.get( + context.adapter.USER_TOKEN_CLIENT_KEY + ) + + # resolve handler id + auth_handler: AuthHandler = self.resolve_handler(auth_handler_id) + auth_handler_id = auth_handler.name + + channel_id, user_id = self._ids_from_context(context) + + ms_app_id = context.turn_state.get(context.adapter.AGENT_IDENTITY_KEY).claims[ + "aud" + ] + + # try to load existing state + flow_storage_client = FlowStorageClient(channel_id, user_id, self._storage) + logger.info("Loading OAuth flow state from storage") + flow_state: FlowState = await flow_storage_client.read(auth_handler_id) + + if not flow_state: + logger.info("No existing flow state found, creating new flow state") + flow_state = FlowState( + channel_id=channel_id, + user_id=user_id, + auth_handler_id=auth_handler_id, + connection=auth_handler.abs_oauth_connection_name, + ms_app_id=ms_app_id, + ) + await flow_storage_client.write(flow_state) + + flow = OAuthFlow(flow_state, user_token_client) + return flow, flow_storage_client + + @asynccontextmanager + async def open_flow( + self, context: TurnContext, auth_handler_id: str = "" + ) -> AsyncIterator[OAuthFlow]: + """Loads an OAuth flow and saves changes the changes to storage if any are made. + + Args: + context: The context object for the current turn. + auth_handler_id: ID of the auth handler to use. + If none provided, uses the first handler. + + Yields: + OAuthFlow: + The OAuthFlow instance loaded from storage or newly created + if not yet present in storage. + """ + if not context: + logger.error("No context provided to open_flow") + raise ValueError("context is required") + + flow, flow_storage_client = await self._load_flow(context, auth_handler_id) + yield flow + logger.info("Saving OAuth flow state to storage") + await flow_storage_client.write(flow.flow_state) + + async def get_token( + self, context: TurnContext, auth_handler_id: str + ) -> TokenResponse: + """ + Gets the token for a specific auth handler. + + Args: + context: The context object for the current turn. + auth_handler_id: Optional ID of the auth handler to use, defaults to first handler. + + Returns: + The token response from the OAuth provider. + """ + logger.info("Getting token for auth handler: %s", auth_handler_id) + async with self.open_flow(context, auth_handler_id) as flow: + return await flow.get_user_token() + + async def exchange_token( + self, + context: TurnContext, + scopes: list[str], + auth_handler_id: Optional[str] = None, + ) -> TokenResponse: + """ + Exchanges a token for another token with different scopes. + + Args: + context: The context object for the current turn. + scopes: The scopes to request for the new token. + auth_handler_id: Optional ID of the auth handler to use, defaults to first handler. + + Returns: + The token response from the OAuth provider. + """ + logger.info("Exchanging token for scopes: %s", scopes) + async with self.open_flow(context, auth_handler_id) as flow: + token_response = await flow.get_user_token() + + if token_response and self._is_exchangeable(token_response.token): + logger.debug("Token is exchangeable, performing OBO flow") + return await self._handle_obo(token_response.token, scopes, auth_handler_id) + + return TokenResponse() + + def _is_exchangeable(self, token: str) -> bool: + """ + Checks if a token is exchangeable (has api:// audience). + + Args: + token: The token to check. + + Returns: + True if the token is exchangeable, False otherwise. + """ + try: + # Decode without verification to check the audience + payload = jwt.decode(token, options={"verify_signature": False}) + aud = payload.get("aud") + return isinstance(aud, str) and aud.startswith("api://") + except Exception: + logger.error("Failed to decode token to check audience") + return False + + async def _handle_obo( + self, token: str, scopes: list[str], handler_id: str = None + ) -> TokenResponse: + """ + Handles On-Behalf-Of token exchange. + + Args: + context: The context object for the current turn. + token: The original token. + scopes: The scopes to request. + + Returns: + The new token response. + + """ + auth_handler = self.resolve_handler(handler_id) + token_provider: AccessTokenProviderBase = ( + self._connection_manager.get_connection(auth_handler.obo_connection_name) + ) + + logger.info("Attempting to exchange token on behalf of user") + new_token = await token_provider.aquire_token_on_behalf_of( + scopes=scopes, + user_assertion=token, + ) + return TokenResponse( + token=new_token, + scopes=scopes, # Expiration can be set based on the token provider's response + ) + + async def get_active_flow_state(self, context: TurnContext) -> Optional[FlowState]: + """Gets the first active flow state for the current context.""" + logger.debug("Getting active flow state") + channel_id, user_id = self._ids_from_context(context) + flow_storage_client = FlowStorageClient(channel_id, user_id, self._storage) + for auth_handler_id in self._auth_handlers.keys(): + flow_state = await flow_storage_client.read(auth_handler_id) + if flow_state and flow_state.is_active(): + return flow_state + return None + + async def begin_or_continue_flow( + self, + context: TurnContext, + turn_state: TurnState, + auth_handler_id: str = "", + ) -> FlowResponse: + """Begins or continues an OAuth flow. + + Args: + context: The context object for the current turn. + turn_state: The state object for the current turn. + auth_handler_id: Optional ID of the auth handler to use, defaults to first handler. + + Returns: + The token response from the OAuth provider. + + """ + if not auth_handler_id: + auth_handler_id = self.resolve_handler().name + + logger.debug("Beginning or continuing OAuth flow") + async with self.open_flow(context, auth_handler_id) as flow: + prev_tag = flow.flow_state.tag + flow_response: FlowResponse = await flow.begin_or_continue_flow( + context.activity + ) + + flow_state: FlowState = flow_response.flow_state + + if ( + flow_state.tag == FlowStateTag.COMPLETE + and prev_tag != FlowStateTag.COMPLETE + ): + logger.debug("Calling Authorization sign in success handler") + self._sign_in_success_handler( + context, turn_state, flow_state.auth_handler_id + ) + elif flow_state.tag == FlowStateTag.FAILURE: + logger.debug("Calling Authorization sign in failure handler") + self._sign_in_failure_handler( + context, + turn_state, + flow_state.auth_handler_id, + flow_response.flow_error_tag, + ) + + return flow_response + + def resolve_handler(self, auth_handler_id: Optional[str] = None) -> AuthHandler: + """Resolves the auth handler to use based on the provided ID. + + Args: + auth_handler_id: Optional ID of the auth handler to resolve, defaults to first handler. + + Returns: + The resolved auth handler. + """ + if auth_handler_id: + if auth_handler_id not in self._auth_handlers: + logger.error("Auth handler '%s' not found", auth_handler_id) + raise ValueError(f"Auth handler '{auth_handler_id}' not found") + return self._auth_handlers[auth_handler_id] + + # Return the first handler if no ID specified + return next(iter(self._auth_handlers.values())) + + async def _sign_out( + self, + context: TurnContext, + auth_handler_ids: Iterable[str], + ) -> None: + """Signs out from the specified auth handlers. + + Args: + context: The context object for the current turn. + auth_handler_ids: Iterable of auth handler IDs to sign out from. + + Deletes the associated flow states from storage. + """ + for auth_handler_id in auth_handler_ids: + flow, flow_storage_client = await self._load_flow(context, auth_handler_id) + # ensure that the id is valid + self.resolve_handler(auth_handler_id) + logger.info("Signing out from handler: %s", auth_handler_id) + await flow.sign_out() + await flow_storage_client.delete(auth_handler_id) + + async def sign_out( + self, + context: TurnContext, + auth_handler_id: Optional[str] = None, + ) -> None: + """ + Signs out the current user. + This method clears the user's token and resets the OAuth state. + + Args: + context: The context object for the current turn. + auth_handler_id: Optional ID of the auth handler to use for sign out. If None, + signs out from all the handlers. + + Deletes the associated flow state(s) from storage. + """ + if auth_handler_id: + await self._sign_out(context, [auth_handler_id]) + else: + await self._sign_out(context, self._auth_handlers.keys()) + + def on_sign_in_success( + self, + handler: Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]], + ) -> None: + """ + Sets a handler to be called when sign-in is successfully completed. + + Args: + handler: The handler function to call on successful sign-in. + """ + self._sign_in_success_handler = handler + + def on_sign_in_failure( + self, + handler: Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]], + ) -> None: + """ + Sets a handler to be called when sign-in fails. + Args: + handler: The handler function to call on sign-in failure. + """ + self._sign_in_failure_handler = handler diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/query.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/query.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/query.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/query.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/route.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/route.py similarity index 93% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/route.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/route.py index 7eae71d6..df85c5a9 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/route.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/route.py @@ -7,7 +7,7 @@ from typing import Awaitable, Callable, Generic, List, TypeVar -from microsoft.agents.hosting.core import TurnContext +from microsoft_agents.hosting.core import TurnContext from .state import TurnState StateT = TypeVar("StateT", bound=TurnState) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/conversation_state.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/conversation_state.py similarity index 87% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/conversation_state.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/conversation_state.py index 9e18e915..d1baac17 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/conversation_state.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/conversation_state.py @@ -8,10 +8,10 @@ from typing import Type -from microsoft.agents.hosting.core.storage import Storage, StoreItem +from microsoft_agents.hosting.core.storage import Storage, StoreItem -from microsoft.agents.hosting.core.turn_context import TurnContext -from microsoft.agents.hosting.core.state import AgentState +from microsoft_agents.hosting.core.turn_context import TurnContext +from microsoft_agents.hosting.core.state import AgentState logger = logging.getLogger(__name__) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/state.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/state.py similarity index 96% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/state.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/state.py index dd72a46e..6a1a5260 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/state.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/state.py @@ -11,11 +11,11 @@ from copy import deepcopy from typing import Any, Callable, List, Optional, Type, TypeVar, Union, overload -from microsoft.agents.hosting.core.state.state_property_accessor import ( +from microsoft_agents.hosting.core.state.state_property_accessor import ( StatePropertyAccessor as _StatePropertyAccessor, ) -from microsoft.agents.hosting.core.storage import Storage, StoreItem -from microsoft.agents.hosting.core.turn_context import TurnContext +from microsoft_agents.hosting.core.storage import Storage, StoreItem +from microsoft_agents.hosting.core.turn_context import TurnContext logger = logging.getLogger(__name__) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/temp_state.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/temp_state.py similarity index 92% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/temp_state.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/temp_state.py index b32ae3cb..546d53b4 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/temp_state.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/temp_state.py @@ -7,11 +7,11 @@ from typing import Dict, List, Optional, TypeVar, Callable, Any, Generic -from microsoft.agents.hosting.core.storage import Storage +from microsoft_agents.hosting.core.storage import Storage -from microsoft.agents.hosting.core.turn_context import TurnContext -from microsoft.agents.hosting.core.app.input_file import InputFile -from microsoft.agents.hosting.core.state import AgentState +from microsoft_agents.hosting.core.turn_context import TurnContext +from microsoft_agents.hosting.core.app.input_file import InputFile +from microsoft_agents.hosting.core.state import AgentState T = TypeVar("T") diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/turn_state.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/turn_state.py similarity index 96% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/turn_state.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/turn_state.py index 7146a085..bf6dce74 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/state/turn_state.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/state/turn_state.py @@ -9,13 +9,13 @@ from typing import Any, Dict, Optional, Type, TypeVar, cast, Callable, Awaitable import asyncio -from microsoft.agents.hosting.core.storage import Storage +from microsoft_agents.hosting.core.storage import Storage -from microsoft.agents.hosting.core.turn_context import TurnContext -from microsoft.agents.hosting.core.app.state.conversation_state import ConversationState -from microsoft.agents.hosting.core.state import AgentState -from microsoft.agents.hosting.core.app.state.temp_state import TempState -from microsoft.agents.hosting.core.state.user_state import UserState +from microsoft_agents.hosting.core.turn_context import TurnContext +from microsoft_agents.hosting.core.app.state.conversation_state import ConversationState +from microsoft_agents.hosting.core.state import AgentState +from microsoft_agents.hosting.core.app.state.temp_state import TempState +from microsoft_agents.hosting.core.state.user_state import UserState logger = logging.getLogger(__name__) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/typing_indicator.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/typing_indicator.py similarity index 92% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/typing_indicator.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/typing_indicator.py index 308ef747..b33c568f 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/typing_indicator.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/typing_indicator.py @@ -9,8 +9,8 @@ from threading import Timer from typing import Optional -from microsoft.agents.hosting.core import TurnContext -from microsoft.agents.activity import Activity, ActivityTypes +from microsoft_agents.hosting.core import TurnContext +from microsoft_agents.activity import Activity, ActivityTypes logger = logging.getLogger(__name__) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/access_token_provider_base.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/access_token_provider_base.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/access_token_provider_base.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/access_token_provider_base.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/agent_auth_configuration.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py similarity index 96% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/agent_auth_configuration.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py index 6086122b..763197e6 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/agent_auth_configuration.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py @@ -1,6 +1,6 @@ from typing import Optional -from microsoft.agents.hosting.core.authorization.auth_types import AuthTypes +from microsoft_agents.hosting.core.authorization.auth_types import AuthTypes class AgentAuthConfiguration: diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/anonymous_token_provider.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/anonymous_token_provider.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/auth_types.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/auth_types.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/auth_types.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/auth_types.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/authentication_constants.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/authentication_constants.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/authentication_constants.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/authentication_constants.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/claims_identity.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/claims_identity.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/claims_identity.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/claims_identity.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/connections.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/connections.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/connections.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/connections.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/jwt_token_validator.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/jwt_token_validator.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/authorization/jwt_token_validator.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/jwt_token_validator.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/card_factory.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/card_factory.py similarity index 99% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/card_factory.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/card_factory.py index f218f150..5ec36994 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/card_factory.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/card_factory.py @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( AnimationCard, Attachment, AudioCard, diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_adapter.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_adapter.py similarity index 94% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_adapter.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_adapter.py index 14efd136..312b5f27 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_adapter.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_adapter.py @@ -4,9 +4,9 @@ from abc import ABC, abstractmethod from collections.abc import Callable from typing import List, Awaitable -from microsoft.agents.hosting.core.authorization import ClaimsIdentity -from microsoft.agents.activity import ChannelAdapterProtocol -from microsoft.agents.activity import ( +from microsoft_agents.hosting.core.authorization import ClaimsIdentity +from microsoft_agents.activity import ChannelAdapterProtocol +from microsoft_agents.activity import ( Activity, ConversationAccount, ConversationReference, @@ -103,8 +103,8 @@ async def continue_conversation( :type reference: :class:`hosting.schema.ConversationReference` :param callback: The method to call for the resulting agent turn. :type callback: :class:`typing.Callable` - :param claims_identity: A :class:`microsoft.agents.authentication.ClaimsIdentity` for the conversation. - :type claims_identity: :class:`microsoft.agents.authentication.ClaimsIdentity` + :param claims_identity: A :class:`microsoft_agents.authentication.ClaimsIdentity` for the conversation. + :type claims_identity: :class:`microsoft_agents.authentication.ClaimsIdentity` :param audience:A value signifying the recipient of the proactive message. :type audience: str """ @@ -123,8 +123,8 @@ async def continue_conversation_with_claims( Most channels require a user to initiate a conversation with an agent before the agent can send activities to the user. - :param claims_identity: A :class:`microsoft.agents.authentication.ClaimsIdentity` for the conversation. - :type claims_identity: :class:`microsoft.agents.authentication.ClaimsIdentity` + :param claims_identity: A :class:`microsoft_agents.authentication.ClaimsIdentity` for the conversation. + :type claims_identity: :class:`microsoft_agents.authentication.ClaimsIdentity` :param continuation_activity: The activity to send. :type continuation_activity: :class:`hosting :param callback: The method to call for the resulting agent turn. @@ -155,7 +155,7 @@ async def create_conversation( :param audience: A value signifying the recipient of the proactive message. :type audience: str :param conversation_parameters: The information to use to create the conversation - :type conversation_parameters: :class:`microsoft.agents.activity.models.ConversationParameters` + :type conversation_parameters: :class:`microsoft_agents.activity.models.ConversationParameters` :param callback: The method to call for the resulting agent turn. :type callback: :class:`typing.Callable[[TurnContext], Awaitable]` @@ -173,7 +173,7 @@ async def create_conversation( If the conversation is established with the specified users, the ID of the activity will contain the ID of the new conversation. """ - from microsoft.agents.activity import ActivityTypes + from microsoft_agents.activity import ActivityTypes # If credentials are not provided, we can't create a conversation if not conversation_parameters: diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_api_handler_protocol.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_api_handler_protocol.py similarity index 97% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_api_handler_protocol.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_api_handler_protocol.py index 8c1455f8..364e679c 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_api_handler_protocol.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_api_handler_protocol.py @@ -1,7 +1,7 @@ from abc import abstractmethod from typing import Protocol, Optional -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, AttachmentData, ChannelAccount, @@ -13,7 +13,7 @@ Transcript, ) -from microsoft.agents.hosting.core.authorization import ClaimsIdentity +from microsoft_agents.hosting.core.authorization import ClaimsIdentity class ChannelApiHandlerProtocol(Protocol): diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_service_adapter.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_adapter.py similarity index 99% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_service_adapter.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_adapter.py index 128a9b20..0ebfa695 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_service_adapter.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_adapter.py @@ -10,7 +10,7 @@ from typing import Awaitable, Callable, cast from uuid import uuid4 -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, ActivityEventNames, ActivityTypes, @@ -25,13 +25,13 @@ InvokeResponse, ResourceResponse, ) -from microsoft.agents.hosting.core.connector import ( +from microsoft_agents.hosting.core.connector import ( ConnectorClientBase, UserTokenClientBase, ConnectorClient, UserTokenClient, ) -from microsoft.agents.hosting.core.authorization import ( +from microsoft_agents.hosting.core.authorization import ( AuthenticationConstants, ClaimsIdentity, ) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_service_client_factory_base.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_client_factory_base.py similarity index 91% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_service_client_factory_base.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_client_factory_base.py index 2e2c60c3..d311781d 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/channel_service_client_factory_base.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_client_factory_base.py @@ -1,8 +1,8 @@ from typing import Protocol, Optional from abc import abstractmethod -from microsoft.agents.hosting.core.authorization import ClaimsIdentity -from microsoft.agents.hosting.core.connector import ( +from microsoft_agents.hosting.core.authorization import ClaimsIdentity +from microsoft_agents.hosting.core.connector import ( ConnectorClientBase, UserTokenClientBase, ) diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/agent_conversation_reference.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/agent_conversation_reference.py similarity index 66% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/agent_conversation_reference.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/agent_conversation_reference.py index 406cf4d8..5fc7c15d 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/agent_conversation_reference.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/agent_conversation_reference.py @@ -1,4 +1,4 @@ -from microsoft.agents.activity import AgentsModel, ConversationReference +from microsoft_agents.activity import AgentsModel, ConversationReference class AgentConversationReference(AgentsModel): diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_factory_protocol.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_factory_protocol.py similarity index 78% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_factory_protocol.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_factory_protocol.py index c9eeec20..24e920a6 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_factory_protocol.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_factory_protocol.py @@ -1,6 +1,6 @@ from typing import Protocol -from microsoft.agents.hosting.core.authorization import AccessTokenProviderBase +from microsoft_agents.hosting.core.authorization import AccessTokenProviderBase from .channel_protocol import ChannelProtocol diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_host_protocol.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_host_protocol.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_host_protocol.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_host_protocol.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_info_protocol.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_info_protocol.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_info_protocol.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_info_protocol.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_protocol.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_protocol.py similarity index 86% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_protocol.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_protocol.py index 4a60ec81..73f3189d 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channel_protocol.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channel_protocol.py @@ -1,6 +1,6 @@ from typing import Protocol -from microsoft.agents.activity import AgentsModel, Activity, InvokeResponse +from microsoft_agents.activity import AgentsModel, Activity, InvokeResponse class ChannelProtocol(Protocol): diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channels_configuration.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channels_configuration.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/channels_configuration.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/channels_configuration.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/configuration_channel_host.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/configuration_channel_host.py similarity index 97% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/configuration_channel_host.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/configuration_channel_host.py index 67017f7e..478da51a 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/configuration_channel_host.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/configuration_channel_host.py @@ -1,6 +1,6 @@ from copy import copy -from microsoft.agents.hosting.core.authorization import Connections +from microsoft_agents.hosting.core.authorization import Connections from .channels_configuration import ChannelsConfiguration from .channel_factory_protocol import ChannelFactoryProtocol diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_constants.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_constants.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_constants.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_constants.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_id_factory.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_id_factory.py similarity index 95% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_id_factory.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_id_factory.py index 89a79fd0..7ba34de2 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_id_factory.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_id_factory.py @@ -2,8 +2,8 @@ from functools import partial from typing import Type -from microsoft.agents.activity import AgentsModel -from microsoft.agents.hosting.core.storage import Storage, StoreItem +from microsoft_agents.activity import AgentsModel +from microsoft_agents.hosting.core.storage import Storage, StoreItem from .agent_conversation_reference import AgentConversationReference from .conversation_id_factory_protocol import ConversationIdFactoryProtocol diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_id_factory_options.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_id_factory_options.py similarity index 91% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_id_factory_options.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_id_factory_options.py index bfbfee0c..034977e7 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_id_factory_options.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_id_factory_options.py @@ -1,4 +1,4 @@ -from microsoft.agents.activity import Activity +from microsoft_agents.activity import Activity from .channel_info_protocol import ChannelInfoProtocol diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_id_factory_protocol.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/conversation_id_factory_protocol.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/http_agent_channel.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/http_agent_channel.py similarity index 97% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/http_agent_channel.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/http_agent_channel.py index 5f138b85..cd4fac10 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/http_agent_channel.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/http_agent_channel.py @@ -1,8 +1,8 @@ from copy import deepcopy, copy from aiohttp import ClientSession -from microsoft.agents.hosting.core.authorization import AccessTokenProviderBase -from microsoft.agents.activity import ( +from microsoft_agents.hosting.core.authorization import AccessTokenProviderBase +from microsoft_agents.activity import ( AgentsModel, Activity, ConversationReference, diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/http_agent_channel_factory.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/http_agent_channel_factory.py similarity index 85% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/http_agent_channel_factory.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/http_agent_channel_factory.py index 95fe928f..d331b0ad 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/client/http_agent_channel_factory.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/client/http_agent_channel_factory.py @@ -1,4 +1,4 @@ -from microsoft.agents.hosting.core.authorization import AccessTokenProviderBase +from microsoft_agents.hosting.core.authorization import AccessTokenProviderBase from .channel_factory_protocol import ChannelFactoryProtocol from .channel_protocol import ChannelProtocol diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/agent_sign_in_base.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/agent_sign_in_base.py similarity index 91% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/agent_sign_in_base.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/agent_sign_in_base.py index 222cb560..75b262eb 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/agent_sign_in_base.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/agent_sign_in_base.py @@ -1,7 +1,7 @@ from abc import abstractmethod from typing import Protocol -from microsoft.agents.activity import SignInResource +from microsoft_agents.activity import SignInResource class AgentSignInBase(Protocol): diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/attachments_base.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/attachments_base.py similarity index 89% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/attachments_base.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/attachments_base.py index 62eb9b58..ea9d2b9c 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/attachments_base.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/attachments_base.py @@ -4,7 +4,7 @@ from abc import abstractmethod from typing import AsyncIterator, Optional, Protocol -from microsoft.agents.activity import AttachmentInfo +from microsoft_agents.activity import AttachmentInfo class AttachmentsBase(Protocol): diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/client/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/client/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/client/connector_client.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py similarity index 99% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/client/connector_client.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py index add7d18a..f713fadf 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/client/connector_client.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py @@ -8,7 +8,7 @@ from aiohttp import ClientSession from io import BytesIO -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, ChannelAccount, ConversationParameters, @@ -17,7 +17,7 @@ ConversationsResult, PagedMembersResult, ) -from microsoft.agents.hosting.core.connector import ConnectorClientBase +from microsoft_agents.hosting.core.connector import ConnectorClientBase from ..attachments_base import AttachmentsBase from ..conversations_base import ConversationsBase from ..get_product_info import get_product_info diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/client/user_token_client.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/user_token_client.py similarity index 98% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/client/user_token_client.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/user_token_client.py index 9f324c5c..7e60df7b 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/client/user_token_client.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/user_token_client.py @@ -7,8 +7,8 @@ from typing import Optional from aiohttp import ClientSession -from microsoft.agents.hosting.core.connector import UserTokenClientBase -from microsoft.agents.activity import TokenResponse, TokenStatus, SignInResource +from microsoft_agents.hosting.core.connector import UserTokenClientBase +from microsoft_agents.activity import TokenResponse, TokenStatus, SignInResource from ..get_product_info import get_product_info from ..user_token_base import UserTokenBase from ..agent_sign_in_base import AgentSignInBase diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/connector_client_base.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/connector_client_base.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/connector_client_base.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/connector_client_base.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/conversations_base.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/conversations_base.py similarity index 98% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/conversations_base.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/conversations_base.py index 2b27caef..1c71ca98 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/conversations_base.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/conversations_base.py @@ -4,7 +4,7 @@ from abc import abstractmethod from typing import Protocol, Optional -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( AttachmentInfo, ConversationResourceResponse, ConversationsResult, diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/get_product_info.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/get_product_info.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/get_product_info.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/get_product_info.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/teams/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/teams/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/teams/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/teams/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/teams/teams_connector_client.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py similarity index 97% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/teams/teams_connector_client.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py index 8fb3110a..6ed53bfd 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/teams/teams_connector_client.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py @@ -6,15 +6,15 @@ from typing import Any from aiohttp import ClientSession -from microsoft.agents.activity import Activity, ResourceResponse -from microsoft.agents.hosting.core.authorization import ( +from microsoft_agents.activity import Activity, ResourceResponse +from microsoft_agents.hosting.core.authorization import ( AccessTokenProviderBase, AgentAuthConfiguration, ) -from microsoft.agents.hosting.core.connector.client import ConnectorClient +from microsoft_agents.hosting.core.connector.client import ConnectorClient -from microsoft.agents.activity import ConversationParameters -from microsoft.agents.activity.teams import ( +from microsoft_agents.activity import ConversationParameters +from microsoft_agents.activity.teams import ( TeamsChannelAccount, TeamsPagedMembersResult, TeamDetails, diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/user_token_base.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/user_token_base.py similarity index 94% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/user_token_base.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/user_token_base.py index 28e94987..cda2da07 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/user_token_base.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/user_token_base.py @@ -1,7 +1,7 @@ from abc import abstractmethod from typing import Protocol -from microsoft.agents.activity import TokenResponse, TokenStatus +from microsoft_agents.activity import TokenResponse, TokenStatus class UserTokenBase(Protocol): diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/user_token_client_base.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/user_token_client_base.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/connector/user_token_client_base.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/user_token_client_base.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/message_factory.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/message_factory.py similarity index 99% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/message_factory.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/message_factory.py index 4188e73a..424a4024 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/message_factory.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/message_factory.py @@ -3,7 +3,7 @@ from __future__ import annotations -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( ActivityTypes, Activity, Attachment, diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/middleware_set.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/middleware_set.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/middleware_set.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/middleware_set.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/flow_state.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/flow_state.py similarity index 97% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/flow_state.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/flow_state.py index 1ac105df..efeb7cb2 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/flow_state.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/flow_state.py @@ -7,7 +7,7 @@ from pydantic import BaseModel -from microsoft.agents.activity import Activity +from microsoft_agents.activity import Activity from ..storage import StoreItem diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/flow_storage_client.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/flow_storage_client.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/flow_storage_client.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/flow_storage_client.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/oauth_flow.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/oauth_flow.py similarity index 99% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/oauth_flow.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/oauth_flow.py index b5f0d5bb..bab9d143 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/oauth_flow.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/oauth_flow.py @@ -9,7 +9,7 @@ from datetime import datetime from typing import Optional -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, ActivityTypes, TokenExchangeState, diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/rest_channel_service_client_factory.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/rest_channel_service_client_factory.py similarity index 88% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/rest_channel_service_client_factory.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/rest_channel_service_client_factory.py index 10f35e70..af280654 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/rest_channel_service_client_factory.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/rest_channel_service_client_factory.py @@ -1,15 +1,15 @@ from typing import Optional -from microsoft.agents.hosting.core.authorization import ( +from microsoft_agents.hosting.core.authorization import ( AuthenticationConstants, AnonymousTokenProvider, ClaimsIdentity, Connections, ) -from microsoft.agents.hosting.core.authorization import AccessTokenProviderBase -from microsoft.agents.hosting.core.connector import ConnectorClientBase -from microsoft.agents.hosting.core.connector.client import UserTokenClient -from microsoft.agents.hosting.core.connector.teams import TeamsConnectorClient +from microsoft_agents.hosting.core.authorization import AccessTokenProviderBase +from microsoft_agents.hosting.core.connector import ConnectorClientBase +from microsoft_agents.hosting.core.connector.client import UserTokenClient +from microsoft_agents.hosting.core.connector.teams import TeamsConnectorClient from .channel_service_client_factory_base import ChannelServiceClientFactoryBase diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/agent_state.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/agent_state.py similarity index 99% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/agent_state.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/agent_state.py index d0056552..a30312b6 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/agent_state.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/agent_state.py @@ -7,7 +7,7 @@ from copy import deepcopy from typing import Callable, Dict, Union, Type -from microsoft.agents.hosting.core.storage import Storage, StoreItem +from microsoft_agents.hosting.core.storage import Storage, StoreItem from .state_property_accessor import StatePropertyAccessor from ..turn_context import TurnContext diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/state_property_accessor.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/state_property_accessor.py similarity index 95% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/state_property_accessor.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/state_property_accessor.py index f90d7a38..4ad56489 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/state_property_accessor.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/state_property_accessor.py @@ -5,7 +5,7 @@ from collections.abc import Callable from typing import Protocol, Type, Union -from microsoft.agents.hosting.core.storage import StoreItem +from microsoft_agents.hosting.core.storage import StoreItem from ..turn_context import TurnContext diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/user_state.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/user_state.py similarity index 96% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/user_state.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/user_state.py index 151cb1fe..758a1aec 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/state/user_state.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/user_state.py @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from microsoft.agents.hosting.core.storage import Storage +from microsoft_agents.hosting.core.storage import Storage from ..turn_context import TurnContext from .agent_state import AgentState diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/__init__.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/__init__.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/_type_aliases.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/_type_aliases.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/_type_aliases.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/_type_aliases.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/error_handling.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/error_handling.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/error_handling.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/error_handling.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/memory_storage.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/memory_storage.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/memory_storage.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/memory_storage.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/storage.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/storage.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/storage.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/storage.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/storage_test_utils.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/storage_test_utils.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/storage_test_utils.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/storage_test_utils.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/store_item.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/store_item.py similarity index 100% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/storage/store_item.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/store_item.py diff --git a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/turn_context.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/turn_context.py similarity index 98% rename from libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/turn_context.py rename to libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/turn_context.py index 5dc1b656..70e022a4 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/turn_context.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/turn_context.py @@ -7,8 +7,8 @@ from copy import copy, deepcopy from collections.abc import Callable from datetime import datetime, timezone -from microsoft.agents.activity import TurnContextProtocol -from microsoft.agents.activity import ( +from microsoft_agents.activity import TurnContextProtocol +from microsoft_agents.activity import ( Activity, ActivityTypes, ConversationReference, @@ -133,7 +133,7 @@ def streaming_response(self): # Use lazy import to avoid circular dependency if not hasattr(self, "_streaming_response"): try: - from microsoft.agents.hosting.aiohttp.app.streaming import ( + from microsoft_agents.hosting.aiohttp.app.streaming import ( StreamingResponse, ) diff --git a/libraries/microsoft-agents-hosting-core/tests/test_activity_handler.py b/libraries/microsoft-agents-hosting-core/tests/test_activity_handler.py index fa102656..12aa5751 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_activity_handler.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_activity_handler.py @@ -1,7 +1,7 @@ import pytest from unittest.mock import AsyncMock -from microsoft.agents.hosting.core import ActivityHandler, TurnContext -from microsoft.agents.activity import ( +from microsoft_agents.hosting.core import ActivityHandler, TurnContext +from microsoft_agents.activity import ( ActivityTypes, ChannelAccount, MessageReaction, diff --git a/libraries/microsoft-agents-hosting-core/tests/test_agent_state.py b/libraries/microsoft-agents-hosting-core/tests/test_agent_state.py index d83cc2bc..668ded70 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_agent_state.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_agent_state.py @@ -10,16 +10,16 @@ from typing import Type from unittest.mock import AsyncMock, MagicMock -from microsoft.agents.hosting.core.state.agent_state import ( +from microsoft_agents.hosting.core.state.agent_state import ( AgentState, CachedAgentState, BotStatePropertyAccessor, ) -from microsoft.agents.hosting.core.state.user_state import UserState -from microsoft.agents.hosting.core.app.state.conversation_state import ConversationState -from microsoft.agents.hosting.core.turn_context import TurnContext -from microsoft.agents.hosting.core.storage import Storage, StoreItem, MemoryStorage -from microsoft.agents.activity import ( +from microsoft_agents.hosting.core.state.user_state import UserState +from microsoft_agents.hosting.core.app.state.conversation_state import ConversationState +from microsoft_agents.hosting.core.turn_context import TurnContext +from microsoft_agents.hosting.core.storage import Storage, StoreItem, MemoryStorage +from microsoft_agents.activity import ( Activity, ActivityTypes, ChannelAccount, diff --git a/libraries/microsoft-agents-hosting-core/tests/test_auth_configuration.py b/libraries/microsoft-agents-hosting-core/tests/test_auth_configuration.py index 1390b66d..59cf9804 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_auth_configuration.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_auth_configuration.py @@ -1,7 +1,7 @@ from os import environ from typing import Dict -from microsoft.agents.activity import load_configuration_from_env -from microsoft.agents.hosting.core import AgentAuthConfiguration, AuthTypes +from microsoft_agents.activity import load_configuration_from_env +from microsoft_agents.hosting.core import AgentAuthConfiguration, AuthTypes class TestAuthorizationConfiguration: diff --git a/libraries/microsoft-agents-hosting-core/tests/test_authorization.py b/libraries/microsoft-agents-hosting-core/tests/test_authorization.py index d80f2a9a..bd71952e 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_authorization.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_authorization.py @@ -2,16 +2,16 @@ import jwt -from microsoft.agents.activity import ActivityTypes, TokenResponse -from microsoft.agents.hosting.core import MemoryStorage -from microsoft.agents.hosting.core.storage.storage_test_utils import StorageBaseline -from microsoft.agents.hosting.core.connector.user_token_base import UserTokenBase -from microsoft.agents.hosting.core.connector.user_token_client_base import ( +from microsoft_agents.activity import ActivityTypes, TokenResponse +from microsoft_agents.hosting.core import MemoryStorage +from microsoft_agents.hosting.core.storage.storage_test_utils import StorageBaseline +from microsoft_agents.hosting.core.connector.user_token_base import UserTokenBase +from microsoft_agents.hosting.core.connector.user_token_client_base import ( UserTokenClientBase, ) -from microsoft.agents.hosting.core.app.oauth import Authorization -from microsoft.agents.hosting.core.oauth import ( +from microsoft_agents.hosting.core.app.oauth import Authorization +from microsoft_agents.hosting.core.oauth import ( FlowStorageClient, FlowErrorTag, FlowStateTag, diff --git a/libraries/microsoft-agents-hosting-core/tests/test_error_handling.py b/libraries/microsoft-agents-hosting-core/tests/test_error_handling.py index f912455b..b35c1a3a 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_error_handling.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_error_handling.py @@ -1,5 +1,5 @@ import pytest -from microsoft.agents.hosting.core.storage.error_handling import ( +from microsoft_agents.hosting.core.storage.error_handling import ( ignore_error, is_status_code_error, ) diff --git a/libraries/microsoft-agents-hosting-core/tests/test_flow_state.py b/libraries/microsoft-agents-hosting-core/tests/test_flow_state.py index 84c669e6..1b17b939 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_flow_state.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_flow_state.py @@ -2,7 +2,7 @@ import pytest -from microsoft.agents.hosting.core.oauth.flow_state import FlowState, FlowStateTag +from microsoft_agents.hosting.core.oauth.flow_state import FlowState, FlowStateTag class TestFlowState: diff --git a/libraries/microsoft-agents-hosting-core/tests/test_flow_storage_client.py b/libraries/microsoft-agents-hosting-core/tests/test_flow_storage_client.py index caa65b29..cd0dd0ae 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_flow_storage_client.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_flow_storage_client.py @@ -1,8 +1,8 @@ import pytest -from microsoft.agents.hosting.core.storage import MemoryStorage -from microsoft.agents.hosting.core.storage.storage_test_utils import MockStoreItem -from microsoft.agents.hosting.core.oauth import FlowState, FlowStorageClient +from microsoft_agents.hosting.core.storage import MemoryStorage +from microsoft_agents.hosting.core.storage.storage_test_utils import MockStoreItem +from microsoft_agents.hosting.core.oauth import FlowState, FlowStorageClient class TestFlowStorageClient: diff --git a/libraries/microsoft-agents-hosting-core/tests/test_memory_storage.py b/libraries/microsoft-agents-hosting-core/tests/test_memory_storage.py index 421af72a..1ecaef4a 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_memory_storage.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_memory_storage.py @@ -1,5 +1,5 @@ -from microsoft.agents.hosting.core.storage.memory_storage import MemoryStorage -from microsoft.agents.hosting.core.storage.storage_test_utils import CRUDStorageTests +from microsoft_agents.hosting.core.storage.memory_storage import MemoryStorage +from microsoft_agents.hosting.core.storage.storage_test_utils import CRUDStorageTests class TestMemoryStorage(CRUDStorageTests): diff --git a/libraries/microsoft-agents-hosting-core/tests/test_oauth_flow.py b/libraries/microsoft-agents-hosting-core/tests/test_oauth_flow.py index c99d8886..d01d69eb 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_oauth_flow.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_oauth_flow.py @@ -1,6 +1,6 @@ import pytest -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, ActivityTypes, TokenResponse, @@ -9,14 +9,14 @@ ConversationReference, ChannelAccount, ) -from microsoft.agents.hosting.core.oauth import ( +from microsoft_agents.hosting.core.oauth import ( OAuthFlow, FlowErrorTag, FlowStateTag, FlowResponse, ) -from microsoft.agents.hosting.core.connector.user_token_base import UserTokenBase -from microsoft.agents.hosting.core.connector.user_token_client_base import ( +from microsoft_agents.hosting.core.connector.user_token_base import UserTokenBase +from microsoft_agents.hosting.core.connector.user_token_client_base import ( UserTokenClientBase, ) diff --git a/libraries/microsoft-agents-hosting-core/tests/test_state.py b/libraries/microsoft-agents-hosting-core/tests/test_state.py index 84730af5..02d5ec6c 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_state.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_state.py @@ -7,13 +7,13 @@ import pytest from unittest.mock import AsyncMock, MagicMock -from microsoft.agents.hosting.core.app.state.state import ( +from microsoft_agents.hosting.core.app.state.state import ( State, state, StatePropertyAccessor, ) -from microsoft.agents.hosting.core.turn_context import TurnContext -from microsoft.agents.hosting.core.storage import Storage, StoreItem +from microsoft_agents.hosting.core.turn_context import TurnContext +from microsoft_agents.hosting.core.storage import Storage, StoreItem class MockStoreItem(StoreItem): diff --git a/libraries/microsoft-agents-hosting-core/tests/test_turn_context.py b/libraries/microsoft-agents-hosting-core/tests/test_turn_context.py index dc3c7920..9d49a0f3 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_turn_context.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_turn_context.py @@ -1,7 +1,7 @@ import pytest from typing import Callable, List -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, ActivityTypes, ChannelAccount, @@ -9,7 +9,7 @@ Entity, ResourceResponse, ) -from microsoft.agents.hosting.core import ChannelAdapter, MessageFactory, TurnContext +from microsoft_agents.hosting.core import ChannelAdapter, MessageFactory, TurnContext activity_data = { "type": "message", diff --git a/libraries/microsoft-agents-hosting-core/tests/test_utils.py b/libraries/microsoft-agents-hosting-core/tests/test_utils.py index e0f9f78d..f392773d 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_utils.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_utils.py @@ -1,4 +1,4 @@ -from microsoft.agents.hosting.core.storage.storage_test_utils import ( +from microsoft_agents.hosting.core.storage.storage_test_utils import ( MockStoreItem, MockStoreItemB, my_deepcopy, diff --git a/libraries/microsoft-agents-hosting-core/tests/tools/mock_user_token_client.py b/libraries/microsoft-agents-hosting-core/tests/tools/mock_user_token_client.py index c7ef14eb..a0ba0ace 100644 --- a/libraries/microsoft-agents-hosting-core/tests/tools/mock_user_token_client.py +++ b/libraries/microsoft-agents-hosting-core/tests/tools/mock_user_token_client.py @@ -7,8 +7,8 @@ from typing import Callable, List, Optional, Awaitable from collections import deque -from microsoft.agents.hosting.core.authorization import ClaimsIdentity -from microsoft.agents.activity import ( +from microsoft_agents.hosting.core.authorization import ClaimsIdentity +from microsoft_agents.activity import ( Activity, ActivityTypes, ChannelAccount, @@ -19,9 +19,9 @@ RoleTypes, InvokeResponse, ) -from microsoft.agents.hosting.core.channel_adapter import ChannelAdapter -from microsoft.agents.hosting.core.turn_context import TurnContext -from microsoft.agents.hosting.core.connector import UserTokenClient +from microsoft_agents.hosting.core.channel_adapter import ChannelAdapter +from microsoft_agents.hosting.core.turn_context import TurnContext +from microsoft_agents.hosting.core.connector import UserTokenClient AgentCallbackHandler = Callable[[TurnContext], Awaitable] diff --git a/libraries/microsoft-agents-hosting-core/tests/tools/testing_adapter.py b/libraries/microsoft-agents-hosting-core/tests/tools/testing_adapter.py index e79486b5..780f9b11 100644 --- a/libraries/microsoft-agents-hosting-core/tests/tools/testing_adapter.py +++ b/libraries/microsoft-agents-hosting-core/tests/tools/testing_adapter.py @@ -7,8 +7,8 @@ from typing import Callable, List, Optional, Awaitable from collections import deque -from microsoft.agents.hosting.core.authorization import ClaimsIdentity -from microsoft.agents.activity import ( +from microsoft_agents.hosting.core.authorization import ClaimsIdentity +from microsoft_agents.activity import ( Activity, ActivityTypes, ChannelAccount, @@ -19,9 +19,9 @@ RoleTypes, InvokeResponse, ) -from microsoft.agents.hosting.core.channel_adapter import ChannelAdapter -from microsoft.agents.hosting.core.turn_context import TurnContext -from microsoft.agents.hosting.core.connector import UserTokenClient +from microsoft_agents.hosting.core.channel_adapter import ChannelAdapter +from microsoft_agents.hosting.core.turn_context import TurnContext +from microsoft_agents.hosting.core.connector import UserTokenClient AgentCallbackHandler = Callable[[TurnContext], Awaitable] diff --git a/libraries/microsoft-agents-hosting-core/tests/tools/testing_authorization.py b/libraries/microsoft-agents-hosting-core/tests/tools/testing_authorization.py index 9340f995..5c1f50fc 100644 --- a/libraries/microsoft-agents-hosting-core/tests/tools/testing_authorization.py +++ b/libraries/microsoft-agents-hosting-core/tests/tools/testing_authorization.py @@ -7,7 +7,7 @@ to simulate various authentication states and flow conditions. """ -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( Connections, AccessTokenProviderBase, AuthHandler, @@ -16,12 +16,12 @@ OAuthFlow, ) from typing import Dict, Union -from microsoft.agents.hosting.core.authorization.agent_auth_configuration import ( +from microsoft_agents.hosting.core.authorization.agent_auth_configuration import ( AgentAuthConfiguration, ) -from microsoft.agents.hosting.core.authorization.claims_identity import ClaimsIdentity +from microsoft_agents.hosting.core.authorization.claims_identity import ClaimsIdentity -from microsoft.agents.activity import TokenResponse +from microsoft_agents.activity import TokenResponse from unittest.mock import Mock, AsyncMock diff --git a/libraries/microsoft-agents-hosting-core/tests/tools/testing_flow.py b/libraries/microsoft-agents-hosting-core/tests/tools/testing_flow.py index 04d45046..26cd30d2 100644 --- a/libraries/microsoft-agents-hosting-core/tests/tools/testing_flow.py +++ b/libraries/microsoft-agents-hosting-core/tests/tools/testing_flow.py @@ -7,7 +7,7 @@ from datetime import timedelta from functools import reduce -from microsoft.agents.activity import Activity +from microsoft_agents.activity import Activity T = TypeVar("T") diff --git a/libraries/microsoft-agents-hosting-core/tests/tools/testing_oauth.py b/libraries/microsoft-agents-hosting-core/tests/tools/testing_oauth.py index 1dd8d799..1a3976b8 100644 --- a/libraries/microsoft-agents-hosting-core/tests/tools/testing_oauth.py +++ b/libraries/microsoft-agents-hosting-core/tests/tools/testing_oauth.py @@ -1,7 +1,7 @@ from datetime import datetime -from microsoft.agents.hosting.core.storage.storage_test_utils import MockStoreItem -from microsoft.agents.hosting.core.oauth.flow_state import FlowState, FlowStateTag +from microsoft_agents.hosting.core.storage.storage_test_utils import MockStoreItem +from microsoft_agents.hosting.core.oauth.flow_state import FlowState, FlowStateTag MS_APP_ID = "__ms_app_id" CHANNEL_ID = "__channel_id" diff --git a/libraries/microsoft-agents-hosting-core/tests/tools/testing_utility.py b/libraries/microsoft-agents-hosting-core/tests/tools/testing_utility.py index 75de310d..86eb985e 100644 --- a/libraries/microsoft-agents-hosting-core/tests/tools/testing_utility.py +++ b/libraries/microsoft-agents-hosting-core/tests/tools/testing_utility.py @@ -2,13 +2,13 @@ # Licensed under the MIT License. from .testing_adapter import TestingAdapter -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( Activity, ActivityTypes, ConversationAccount, ChannelAccount, ) -from microsoft.agents.hosting.core import TurnContext +from microsoft_agents.hosting.core import TurnContext class TestingUtility: diff --git a/libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/__init__.py b/libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/__init__.py similarity index 100% rename from libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/__init__.py rename to libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/__init__.py diff --git a/libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_activity_handler.py b/libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/teams_activity_handler.py similarity index 99% rename from libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_activity_handler.py rename to libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/teams_activity_handler.py index 3a1eccdd..17a3d78e 100644 --- a/libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_activity_handler.py +++ b/libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/teams_activity_handler.py @@ -6,13 +6,13 @@ from http import HTTPStatus from typing import Any, List -from microsoft.agents.hosting.core import ActivityHandler, TurnContext -from microsoft.agents.activity import ( +from microsoft_agents.hosting.core import ActivityHandler, TurnContext +from microsoft_agents.activity import ( InvokeResponse, ChannelAccount, ) -from microsoft.agents.activity.teams import ( +from microsoft_agents.activity.teams import ( AppBasedLinkQuery, TeamInfo, ChannelInfo, diff --git a/libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_cloud_adapter.py b/libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/teams_cloud_adapter.py similarity index 100% rename from libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_cloud_adapter.py rename to libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/teams_cloud_adapter.py diff --git a/libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_info.py b/libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/teams_info.py similarity index 98% rename from libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_info.py rename to libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/teams_info.py index c84b41e3..1a4de969 100644 --- a/libraries/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_info.py +++ b/libraries/microsoft-agents-hosting-teams/microsoft_agents/hosting/teams/teams_info.py @@ -5,9 +5,9 @@ from typing import Optional, Tuple, Dict, Any, List -from microsoft.agents.activity import Activity, Channels, ConversationParameters +from microsoft_agents.activity import Activity, Channels, ConversationParameters -from microsoft.agents.activity.teams import ( +from microsoft_agents.activity.teams import ( TeamsChannelAccount, TeamsMeetingParticipant, MeetingInfo, @@ -22,8 +22,8 @@ TeamsBatchOperationResponse, ChannelInfo, ) -from microsoft.agents.hosting.core.connector.teams import TeamsConnectorClient -from microsoft.agents.hosting.core import ChannelServiceAdapter, TurnContext +from microsoft_agents.hosting.core.connector.teams import TeamsConnectorClient +from microsoft_agents.hosting.core import ChannelServiceAdapter, TurnContext class TeamsInfo: diff --git a/libraries/microsoft-agents-storage-blob/microsoft/agents/storage/blob/__init__.py b/libraries/microsoft-agents-storage-blob/microsoft_agents/storage/blob/__init__.py similarity index 100% rename from libraries/microsoft-agents-storage-blob/microsoft/agents/storage/blob/__init__.py rename to libraries/microsoft-agents-storage-blob/microsoft_agents/storage/blob/__init__.py diff --git a/libraries/microsoft-agents-storage-blob/microsoft/agents/storage/blob/blob_storage.py b/libraries/microsoft-agents-storage-blob/microsoft_agents/storage/blob/blob_storage.py similarity index 92% rename from libraries/microsoft-agents-storage-blob/microsoft/agents/storage/blob/blob_storage.py rename to libraries/microsoft-agents-storage-blob/microsoft_agents/storage/blob/blob_storage.py index 02350a29..2a7634b7 100644 --- a/libraries/microsoft-agents-storage-blob/microsoft/agents/storage/blob/blob_storage.py +++ b/libraries/microsoft-agents-storage-blob/microsoft_agents/storage/blob/blob_storage.py @@ -7,10 +7,10 @@ BlobServiceClient, ) -from microsoft.agents.hosting.core.storage import StoreItem -from microsoft.agents.hosting.core.storage.storage import AsyncStorageBase -from microsoft.agents.hosting.core.storage._type_aliases import JSON -from microsoft.agents.hosting.core.storage.error_handling import ( +from microsoft_agents.hosting.core.storage import StoreItem +from microsoft_agents.hosting.core.storage.storage import AsyncStorageBase +from microsoft_agents.hosting.core.storage._type_aliases import JSON +from microsoft_agents.hosting.core.storage.error_handling import ( ignore_error, is_status_code_error, ) diff --git a/libraries/microsoft-agents-storage-blob/microsoft/agents/storage/blob/blob_storage_config.py b/libraries/microsoft-agents-storage-blob/microsoft_agents/storage/blob/blob_storage_config.py similarity index 100% rename from libraries/microsoft-agents-storage-blob/microsoft/agents/storage/blob/blob_storage_config.py rename to libraries/microsoft-agents-storage-blob/microsoft_agents/storage/blob/blob_storage_config.py diff --git a/libraries/microsoft-agents-storage-blob/tests/test_blob_storage.py b/libraries/microsoft-agents-storage-blob/tests/test_blob_storage.py index 4a80b768..5b6ce393 100644 --- a/libraries/microsoft-agents-storage-blob/tests/test_blob_storage.py +++ b/libraries/microsoft-agents-storage-blob/tests/test_blob_storage.py @@ -6,11 +6,11 @@ import pytest import pytest_asyncio -from microsoft.agents.storage.blob import BlobStorage, BlobStorageConfig +from microsoft_agents.storage.blob import BlobStorage, BlobStorageConfig from azure.storage.blob.aio import BlobServiceClient from azure.core.exceptions import ResourceNotFoundError -from microsoft.agents.hosting.core.storage.storage_test_utils import ( +from microsoft_agents.hosting.core.storage.storage_test_utils import ( CRUDStorageTests, StorageBaseline, MockStoreItem, diff --git a/libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/__init__.py b/libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/__init__.py similarity index 100% rename from libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/__init__.py rename to libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/__init__.py diff --git a/libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/cosmos_db_storage.py b/libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/cosmos_db_storage.py similarity index 97% rename from libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/cosmos_db_storage.py rename to libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/cosmos_db_storage.py index ea589c62..16c3246c 100644 --- a/libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/cosmos_db_storage.py +++ b/libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/cosmos_db_storage.py @@ -17,9 +17,9 @@ import azure.cosmos.exceptions as cosmos_exceptions from azure.cosmos.partition_key import NonePartitionKeyValue -from microsoft.agents.hosting.core.storage import AsyncStorageBase, StoreItem -from microsoft.agents.hosting.core.storage._type_aliases import JSON -from microsoft.agents.hosting.core.storage.error_handling import ignore_error +from microsoft_agents.hosting.core.storage import AsyncStorageBase, StoreItem +from microsoft_agents.hosting.core.storage._type_aliases import JSON +from microsoft_agents.hosting.core.storage.error_handling import ignore_error from .cosmos_db_storage_config import CosmosDBStorageConfig from .key_ops import sanitize_key diff --git a/libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/cosmos_db_storage_config.py b/libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/cosmos_db_storage_config.py similarity index 100% rename from libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/cosmos_db_storage_config.py rename to libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/cosmos_db_storage_config.py diff --git a/libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/key_ops.py b/libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/key_ops.py similarity index 100% rename from libraries/microsoft-agents-storage-cosmos/microsoft/agents/storage/cosmos/key_ops.py rename to libraries/microsoft-agents-storage-cosmos/microsoft_agents/storage/cosmos/key_ops.py diff --git a/libraries/microsoft-agents-storage-cosmos/tests/test_cosmos_db_config.py b/libraries/microsoft-agents-storage-cosmos/tests/test_cosmos_db_config.py index 02e47b30..634ab12c 100644 --- a/libraries/microsoft-agents-storage-cosmos/tests/test_cosmos_db_config.py +++ b/libraries/microsoft-agents-storage-cosmos/tests/test_cosmos_db_config.py @@ -1,7 +1,7 @@ import json import pytest -from microsoft.agents.storage.cosmos import CosmosDBStorageConfig +from microsoft_agents.storage.cosmos import CosmosDBStorageConfig # thank you AI, again diff --git a/libraries/microsoft-agents-storage-cosmos/tests/test_cosmos_db_storage.py b/libraries/microsoft-agents-storage-cosmos/tests/test_cosmos_db_storage.py index cd528db1..3890f852 100644 --- a/libraries/microsoft-agents-storage-cosmos/tests/test_cosmos_db_storage.py +++ b/libraries/microsoft-agents-storage-cosmos/tests/test_cosmos_db_storage.py @@ -10,10 +10,10 @@ from azure.cosmos.aio import CosmosClient from azure.cosmos.exceptions import CosmosResourceNotFoundError -from microsoft.agents.storage.cosmos import CosmosDBStorage, CosmosDBStorageConfig -from microsoft.agents.storage.cosmos.key_ops import sanitize_key +from microsoft_agents.storage.cosmos import CosmosDBStorage, CosmosDBStorageConfig +from microsoft_agents.storage.cosmos.key_ops import sanitize_key -from microsoft.agents.hosting.core.storage.storage_test_utils import ( +from microsoft_agents.hosting.core.storage.storage_test_utils import ( QuickCRUDStorageTests, MockStoreItem, MockStoreItemB, diff --git a/libraries/microsoft-agents-storage-cosmos/tests/test_key_ops.py b/libraries/microsoft-agents-storage-cosmos/tests/test_key_ops.py index e554370f..4562d6c9 100644 --- a/libraries/microsoft-agents-storage-cosmos/tests/test_key_ops.py +++ b/libraries/microsoft-agents-storage-cosmos/tests/test_key_ops.py @@ -1,6 +1,6 @@ import hashlib import pytest -from microsoft.agents.storage.cosmos.key_ops import truncate_key, sanitize_key +from microsoft_agents.storage.cosmos.key_ops import truncate_key, sanitize_key # thank you AI diff --git a/test_samples/agent_to_agent/agent_1/agent1.py b/test_samples/agent_to_agent/agent_1/agent1.py index 3f8f8dac..e0d89eee 100644 --- a/test_samples/agent_to_agent/agent_1/agent1.py +++ b/test_samples/agent_to_agent/agent_1/agent1.py @@ -3,8 +3,8 @@ from aiohttp.web import HTTPException -from microsoft.agents.activity import ChannelAdapterProtocol, TurnContextProtocol -from microsoft.agents.activity import ( +from microsoft_agents.activity import ChannelAdapterProtocol, TurnContextProtocol +from microsoft_agents.activity import ( ActivityTypes, Activity, CallerIdConstants, @@ -17,14 +17,14 @@ ConversationResourceResponse, ConversationsResult, ) -from microsoft.agents.hosting.core.authorization import ClaimsIdentity -from microsoft.agents.hosting.core.client import ( +from microsoft_agents.hosting.core.authorization import ClaimsIdentity +from microsoft_agents.hosting.core.client import ( ChannelHostProtocol, ChannelInfoProtocol, ConversationIdFactoryProtocol, ConversationIdFactoryOptions, ) -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( ActivityHandler, ChannelApiHandlerProtocol, ChannelAdapter, diff --git a/test_samples/agent_to_agent/agent_1/app.py b/test_samples/agent_to_agent/agent_1/app.py index a1ee4935..6a76c37c 100644 --- a/test_samples/agent_to_agent/agent_1/app.py +++ b/test_samples/agent_to_agent/agent_1/app.py @@ -4,7 +4,7 @@ from aiohttp.web import Application, Request, Response, run_app from dotenv import load_dotenv -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( Connections, AccessTokenProviderBase, ClaimsIdentity, @@ -14,12 +14,12 @@ MemoryStorage, RestChannelServiceClientFactory, ) -from microsoft.agents.hosting.aiohttp import ( +from microsoft_agents.hosting.aiohttp import ( CloudAdapter, jwt_authorization_middleware, channel_service_route_table, ) -from microsoft.agents.authentication.msal import MsalAuth +from microsoft_agents.authentication.msal import MsalAuth from agent1 import Agent1 from config import DefaultConfig diff --git a/test_samples/agent_to_agent/agent_1/config.py b/test_samples/agent_to_agent/agent_1/config.py index 7e8f4b39..80664b15 100644 --- a/test_samples/agent_to_agent/agent_1/config.py +++ b/test_samples/agent_to_agent/agent_1/config.py @@ -1,6 +1,6 @@ from os import environ -from microsoft.agents.authentication.msal import AuthTypes, MsalAuthConfiguration -from microsoft.agents.hosting.core.client import ( +from microsoft_agents.authentication.msal import AuthTypes, MsalAuthConfiguration +from microsoft_agents.hosting.core.client import ( ChannelHostConfiguration, ChannelsConfiguration, ChannelInfo, diff --git a/test_samples/agent_to_agent/agent_2/agent2.py b/test_samples/agent_to_agent/agent_2/agent2.py index 92f71dbe..9daf56da 100644 --- a/test_samples/agent_to_agent/agent_2/agent2.py +++ b/test_samples/agent_to_agent/agent_2/agent2.py @@ -1,5 +1,5 @@ -from microsoft.agents.hosting.core import ActivityHandler, TurnContext -from microsoft.agents.activity import ( +from microsoft_agents.hosting.core import ActivityHandler, TurnContext +from microsoft_agents.activity import ( ChannelAccount, Activity, EndOfConversationCodes, diff --git a/test_samples/agent_to_agent/agent_2/app.py b/test_samples/agent_to_agent/agent_2/app.py index 17613c06..620b5ff2 100644 --- a/test_samples/agent_to_agent/agent_2/app.py +++ b/test_samples/agent_to_agent/agent_2/app.py @@ -4,14 +4,14 @@ from aiohttp.web import Application, Request, Response, run_app from dotenv import load_dotenv -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( Connections, AccessTokenProviderBase, ClaimsIdentity, RestChannelServiceClientFactory, ) -from microsoft.agents.hosting.aiohttp import CloudAdapter, jwt_authorization_middleware -from microsoft.agents.authentication.msal import MsalAuth +from microsoft_agents.hosting.aiohttp import CloudAdapter, jwt_authorization_middleware +from microsoft_agents.authentication.msal import MsalAuth from agent2 import Agent2 from config import DefaultConfig diff --git a/test_samples/agent_to_agent/agent_2/config.py b/test_samples/agent_to_agent/agent_2/config.py index 63360859..419fa199 100644 --- a/test_samples/agent_to_agent/agent_2/config.py +++ b/test_samples/agent_to_agent/agent_2/config.py @@ -1,5 +1,5 @@ from os import environ -from microsoft.agents.authentication.msal import AuthTypes, MsalAuthConfiguration +from microsoft_agents.authentication.msal import AuthTypes, MsalAuthConfiguration class DefaultConfig(MsalAuthConfiguration): diff --git a/test_samples/app_style/authorization_agent.py b/test_samples/app_style/authorization_agent.py index 5fe111ed..b8ee07b9 100644 --- a/test_samples/app_style/authorization_agent.py +++ b/test_samples/app_style/authorization_agent.py @@ -7,7 +7,7 @@ import traceback from dotenv import load_dotenv -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( Authorization, AgentApplication, TurnState, @@ -15,9 +15,9 @@ MessageFactory, MemoryStorage, ) -from microsoft.agents.activity import load_configuration_from_env, ActivityTypes -from microsoft.agents.hosting.aiohttp import CloudAdapter -from microsoft.agents.authentication.msal import MsalConnectionManager +from microsoft_agents.activity import load_configuration_from_env, ActivityTypes +from microsoft_agents.hosting.aiohttp import CloudAdapter +from microsoft_agents.authentication.msal import MsalConnectionManager from shared import GraphClient, GitHubClient, start_server diff --git a/test_samples/app_style/emtpy_agent.py b/test_samples/app_style/emtpy_agent.py index a0b5e817..dad36347 100644 --- a/test_samples/app_style/emtpy_agent.py +++ b/test_samples/app_style/emtpy_agent.py @@ -1,19 +1,17 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( AgentApplication, TurnState, TurnContext, MemoryStorage, ) -from microsoft.agents.hosting.aiohttp import CloudAdapter +from microsoft_agents.hosting.aiohttp import CloudAdapter from shared import start_server -AGENT_APP = AgentApplication[TurnState]( - storage=MemoryStorage(), adapter=CloudAdapter() -) +AGENT_APP = AgentApplication[TurnState](storage=MemoryStorage(), adapter=CloudAdapter()) async def _help(context: TurnContext, _state: TurnState): diff --git a/test_samples/app_style/mcs_agent.py b/test_samples/app_style/mcs_agent.py index a22dd2f4..e657eb27 100644 --- a/test_samples/app_style/mcs_agent.py +++ b/test_samples/app_style/mcs_agent.py @@ -6,7 +6,7 @@ from typing import Optional from dotenv import load_dotenv -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( Authorization, TurnContext, MessageFactory, @@ -15,19 +15,19 @@ TurnState, ConversationState, ) -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( load_configuration_from_env, ActivityTypes, Activity, ) -from microsoft.agents.copilotstudio.client import ( +from microsoft_agents.copilotstudio.client import ( ConnectionSettings, CopilotClient, PowerPlatformCloud, AgentType, ) -from microsoft.agents.hosting.aiohttp import CloudAdapter -from microsoft.agents.authentication.msal import MsalConnectionManager +from microsoft_agents.hosting.aiohttp import CloudAdapter +from microsoft_agents.authentication.msal import MsalConnectionManager from shared import start_server diff --git a/test_samples/app_style/shared/start_server.py b/test_samples/app_style/shared/start_server.py index 417ba637..fd1846a6 100644 --- a/test_samples/app_style/shared/start_server.py +++ b/test_samples/app_style/shared/start_server.py @@ -1,6 +1,6 @@ from os import environ -from microsoft.agents.hosting.core import AgentApplication, AgentAuthConfiguration -from microsoft.agents.hosting.aiohttp import ( +from microsoft_agents.hosting.core import AgentApplication, AgentAuthConfiguration +from microsoft_agents.hosting.aiohttp import ( start_agent_process, jwt_authorization_middleware, CloudAdapter, diff --git a/test_samples/app_style/streaming_agent.py b/test_samples/app_style/streaming_agent.py index 0d39de3c..e20f902d 100644 --- a/test_samples/app_style/streaming_agent.py +++ b/test_samples/app_style/streaming_agent.py @@ -7,17 +7,17 @@ import traceback from dotenv import load_dotenv, find_dotenv -from microsoft.agents.hosting.aiohttp import CloudAdapter, Citation -from microsoft.agents.authentication.msal import MsalConnectionManager +from microsoft_agents.hosting.aiohttp import CloudAdapter, Citation +from microsoft_agents.authentication.msal import MsalConnectionManager -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( Authorization, AgentApplication, TurnState, TurnContext, MemoryStorage, ) -from microsoft.agents.activity import ( +from microsoft_agents.activity import ( load_configuration_from_env, Activity, ActivityTypes, diff --git a/test_samples/copilot_studio_client_sample/app.py b/test_samples/copilot_studio_client_sample/app.py index 99b50c58..a020e2db 100644 --- a/test_samples/copilot_studio_client_sample/app.py +++ b/test_samples/copilot_studio_client_sample/app.py @@ -3,7 +3,7 @@ from os import environ, path from msal import PublicClientApplication -from microsoft.agents.copilotstudio.client import ConnectionSettings, CopilotClient +from microsoft_agents.copilotstudio.client import ConnectionSettings, CopilotClient from msal_cache_plugin import get_msal_token_cache from chat_console_service import ChatConsoleService diff --git a/test_samples/copilot_studio_client_sample/chat_console_service.py b/test_samples/copilot_studio_client_sample/chat_console_service.py index f967fc24..5e466ec3 100644 --- a/test_samples/copilot_studio_client_sample/chat_console_service.py +++ b/test_samples/copilot_studio_client_sample/chat_console_service.py @@ -1,5 +1,5 @@ -from microsoft.agents.copilotstudio.client import CopilotClient -from microsoft.agents.activity import Activity, ActivityTypes +from microsoft_agents.copilotstudio.client import CopilotClient +from microsoft_agents.activity import Activity, ActivityTypes class ChatConsoleService: diff --git a/test_samples/copilot_studio_client_sample/config.py b/test_samples/copilot_studio_client_sample/config.py index e1d4ed71..6814ef1f 100644 --- a/test_samples/copilot_studio_client_sample/config.py +++ b/test_samples/copilot_studio_client_sample/config.py @@ -1,7 +1,7 @@ from os import environ from typing import Optional -from microsoft.agents.copilotstudio.client import ( +from microsoft_agents.copilotstudio.client import ( ConnectionSettings, PowerPlatformCloud, AgentType, diff --git a/test_samples/teams_agent/app.py b/test_samples/teams_agent/app.py index a3129611..744dc132 100644 --- a/test_samples/teams_agent/app.py +++ b/test_samples/teams_agent/app.py @@ -6,10 +6,10 @@ from dotenv import load_dotenv from aiohttp.web import Application, Request, Response, run_app -from microsoft.agents.activity import load_configuration_from_env -from microsoft.agents.authentication.msal import MsalConnectionManager -from microsoft.agents.hosting.aiohttp import CloudAdapter, jwt_authorization_decorator -from microsoft.agents.hosting.core import Authorization, MemoryStorage, UserState +from microsoft_agents.activity import load_configuration_from_env +from microsoft_agents.authentication.msal import MsalConnectionManager +from microsoft_agents.hosting.aiohttp import CloudAdapter, jwt_authorization_decorator +from microsoft_agents.hosting.core import Authorization, MemoryStorage, UserState from teams_handler import TeamsHandler from teams_sso import TeamsSso diff --git a/test_samples/teams_agent/config.py b/test_samples/teams_agent/config.py index f0496df1..164dc13a 100644 --- a/test_samples/teams_agent/config.py +++ b/test_samples/teams_agent/config.py @@ -1,5 +1,5 @@ from os import environ -from microsoft.agents.hosting.core import AuthTypes, AgentAuthConfiguration +from microsoft_agents.hosting.core import AuthTypes, AgentAuthConfiguration class DefaultConfig(AgentAuthConfiguration): diff --git a/test_samples/teams_agent/helpers/task_module_response_factory.py b/test_samples/teams_agent/helpers/task_module_response_factory.py index 0b192240..dc22eb55 100644 --- a/test_samples/teams_agent/helpers/task_module_response_factory.py +++ b/test_samples/teams_agent/helpers/task_module_response_factory.py @@ -3,7 +3,7 @@ """Factory for creating task module responses.""" -from microsoft.agents.activity.teams import ( +from microsoft_agents.activity.teams import ( TaskModuleResponse, TaskModuleTaskInfo, TaskModuleResponseBase, diff --git a/test_samples/teams_agent/teams_handler.py b/test_samples/teams_agent/teams_handler.py index 0c2fce8e..e671ffbc 100644 --- a/test_samples/teams_agent/teams_handler.py +++ b/test_samples/teams_agent/teams_handler.py @@ -1,7 +1,7 @@ -from microsoft.agents.hosting.core import MessageFactory, TurnContext -from microsoft.agents.hosting.teams import TeamsActivityHandler, TeamsInfo -from microsoft.agents.activity import ChannelAccount, ConversationParameters -from microsoft.agents.activity.teams import MeetingNotification +from microsoft_agents.hosting.core import MessageFactory, TurnContext +from microsoft_agents.hosting.teams import TeamsActivityHandler, TeamsInfo +from microsoft_agents.activity import ChannelAccount, ConversationParameters +from microsoft_agents.activity.teams import MeetingNotification class TeamsHandler(TeamsActivityHandler): diff --git a/test_samples/teams_agent/teams_multi_feature.py b/test_samples/teams_agent/teams_multi_feature.py index 8823e5e9..4d9b5c17 100644 --- a/test_samples/teams_agent/teams_multi_feature.py +++ b/test_samples/teams_agent/teams_multi_feature.py @@ -1,14 +1,14 @@ import json from os import getenv -from microsoft.agents.hosting.core import MessageFactory, TurnContext -from microsoft.agents.activity import ChannelAccount, Attachment -from microsoft.agents.activity.teams import ( +from microsoft_agents.hosting.core import MessageFactory, TurnContext +from microsoft_agents.activity import ChannelAccount, Attachment +from microsoft_agents.activity.teams import ( TaskModuleResponse, TaskModuleTaskInfo, TaskModuleRequest, ) -from microsoft.agents.hosting.teams import ( +from microsoft_agents.hosting.teams import ( TeamsActivityHandler, TeamsInfo, ) diff --git a/test_samples/teams_agent/teams_sso.py b/test_samples/teams_agent/teams_sso.py index 6c0c5c9f..be6bb8f2 100644 --- a/test_samples/teams_agent/teams_sso.py +++ b/test_samples/teams_agent/teams_sso.py @@ -1,12 +1,12 @@ -from microsoft.agents.hosting.core import ( +from microsoft_agents.hosting.core import ( OAuthFlow, MessageFactory, TurnContext, UserState, Storage, ) -from microsoft.agents.activity import ChannelAccount -from microsoft.agents.hosting.teams import TeamsActivityHandler +from microsoft_agents.activity import ChannelAccount +from microsoft_agents.hosting.teams import TeamsActivityHandler from graph_client import GraphClient diff --git a/test_samples/weather-agent-open-ai/app.py b/test_samples/weather-agent-open-ai/app.py index 6e68b6a2..558ff758 100644 --- a/test_samples/weather-agent-open-ai/app.py +++ b/test_samples/weather-agent-open-ai/app.py @@ -4,14 +4,14 @@ from dotenv import load_dotenv from aiohttp.web import Application, Request, Response, run_app -from microsoft.agents.hosting.core import RestChannelServiceClientFactory -from microsoft.agents.hosting.aiohttp import CloudAdapter, jwt_authorization_middleware -from microsoft.agents.hosting.core.authorization import ( +from microsoft_agents.hosting.core import RestChannelServiceClientFactory +from microsoft_agents.hosting.aiohttp import CloudAdapter, jwt_authorization_middleware +from microsoft_agents.hosting.core.authorization import ( Connections, AccessTokenProviderBase, ClaimsIdentity, ) -from microsoft.agents.authentication.msal import MsalAuth +from microsoft_agents.authentication.msal import MsalAuth from openai import AsyncAzureOpenAI from weather_agent import WeatherAgent diff --git a/test_samples/weather-agent-open-ai/config.py b/test_samples/weather-agent-open-ai/config.py index db0afcd9..83c991d8 100644 --- a/test_samples/weather-agent-open-ai/config.py +++ b/test_samples/weather-agent-open-ai/config.py @@ -1,5 +1,5 @@ from os import environ -from microsoft.agents.authentication.msal import AuthTypes, MsalAuthConfiguration +from microsoft_agents.authentication.msal import AuthTypes, MsalAuthConfiguration class DefaultConfig(MsalAuthConfiguration): diff --git a/test_samples/weather-agent-open-ai/weather_agent.py b/test_samples/weather-agent-open-ai/weather_agent.py index f2ee2715..c14a7fd1 100644 --- a/test_samples/weather-agent-open-ai/weather_agent.py +++ b/test_samples/weather-agent-open-ai/weather_agent.py @@ -1,8 +1,8 @@ from __future__ import annotations from typing import Union -from microsoft.agents.hosting.core import ActivityHandler, MessageFactory, TurnContext -from microsoft.agents.activity import ChannelAccount, Attachment +from microsoft_agents.hosting.core import ActivityHandler, MessageFactory, TurnContext +from microsoft_agents.activity import ChannelAccount, Attachment from agents import ( Agent as OpenAIAgent,