Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def supports_suggested_actions(channel_id: Self, button_cnt: int = 100) -> bool:

Args:
channel_id (str): The Channel to check the if Suggested Actions are supported in.
button_cnt (int, optional): Defaults to 100. The number of Suggested Actions to check for the Channel.
button_cnt (int, Optional): Defaults to 100. The number of Suggested Actions to check for the Channel.

Returns:
bool: True if the Channel supports the button_cnt total Suggested Actions, False if the Channel does not
Expand Down Expand Up @@ -107,7 +107,7 @@ def supports_card_actions(channel_id: Self, button_cnt: int = 100) -> bool:

Args:
channel_id (str): The Channel to check if the Card Actions are supported in.
button_cnt (int, optional): Defaults to 100. The number of Card Actions to check for the Channel.
button_cnt (int, Optional): Defaults to 100. The number of Card Actions to check for the Channel.

Returns:
bool: True if the Channel supports the button_cnt total Card Actions, False if the Channel does not support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async def get_user_token(self, magic_code: str = None) -> TokenResponse:
"""Get the user token based on the context.

Args:
magic_code (str, optional): Defaults to None. The magic code for user authentication.
magic_code (str, Optional): Defaults to None. The magic code for user authentication.

Returns:
TokenResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def on_turn(
in order to process an inbound :class:`microsoft_agents.activity.Activity`.

:param turn_context: The context object for this turn
:type turn_context: :class:`microsoft_agents.builder.TurnContext`
:type turn_context: :class:`microsoft_agents.activity.TurnContextProtocol`

:returns: A task that represents the work queued to execute

Expand Down Expand Up @@ -143,7 +143,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.activity.TurnContextProtocol`
:returns: A task that represents the work queued to execute

.. remarks::
Expand Down Expand Up @@ -216,7 +216,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.activity.TurnContextProtocol`

:returns: A task that represents the work queued to execute

Expand Down Expand Up @@ -382,7 +382,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.activity.TurnContextProtocol`
:returns: A task that represents the work queued to execute
"""
return
Expand All @@ -395,7 +395,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.activity.TurnContextProtocol`
:returns: A task that represents the work queued to execute
"""
if turn_context.activity.action in ("add", "add-upgrade"):
Expand All @@ -412,7 +412,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.activity.TurnContextProtocol`
:returns: A task that represents the work queued to execute
"""
return
Expand All @@ -425,7 +425,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.activity.TurnContextProtocol`
:returns: A task that represents the work queued to execute
"""
return
Expand All @@ -439,7 +439,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.activity.TurnContextProtocol`

:returns: A task that represents the work queued to execute

Expand All @@ -456,7 +456,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.activity.TurnContextProtocol`

:returns: A task that represents the work queued to execute
"""
Expand Down Expand Up @@ -492,7 +492,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.activity.TurnContextProtocol`

:returns: A task that represents the work queued to execute
"""
Expand All @@ -508,7 +508,7 @@ 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.activity.TurnContextProtocol`
:param invoke_value: A string-typed object from the incoming activity's value.
:type invoke_value: :class:`microsoft_agents.activity.adaptive_card_invoke_value.AdaptiveCardInvokeValue`
:return: The HealthCheckResponse object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ def add_route(
:param handler: A function that takes a TurnContext and a TurnState and returns an Awaitable.
:type handler: RouteHandler[StateT]
:param is_invoke: Whether the route is for an invoke activity, defaults to False
:type is_invoke: bool, optional
:type is_invoke: bool, Optional
:param is_agentic: Whether the route is for an agentic request, defaults to False. For agentic requests
the selector will include a new check for `context.activity.is_agentic_request()`.
:type is_agentic: bool, optional
:type is_agentic: bool, Optional
:param rank: The rank of the route, defaults to RouteRank.DEFAULT
:type rank: RouteRank, optional
:type rank: RouteRank, Optional
:param auth_handlers: A list of authentication handler IDs to use for this route, defaults to None
:type auth_handlers: Optional[list[str]], optional
:type auth_handlers: Optional[list[str]], Optional
:raises ApplicationError: If the selector or handler are not valid.
"""
if not selector or not handler:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
:param connection_manager: The connection manager for OAuth providers.
:type connection_manager: Connections
:param auth_handlers: Configuration for OAuth providers.
:type auth_handlers: dict[str, AuthHandler], optional
:type auth_handlers: dict[str, AuthHandler], Optional
:raises ValueError: When storage is None or no auth handlers provided.
"""
if not storage:
Expand Down Expand Up @@ -75,7 +75,7 @@ async def _sign_in(
:param context: The turn context for the current turn of conversation.
:type context: TurnContext
:param scopes: Optional list of scopes to request during sign-in. If None, default scopes will be used.
:type scopes: Optional[list[str]], optional
:type scopes: Optional[list[str]], Optional
:return: A SignInResponse indicating the result of the sign-in attempt.
:rtype: SignInResponse
"""
Expand All @@ -92,9 +92,9 @@ async def get_refreshed_token(
:param context: The turn context for the current turn of conversation.
:type context: TurnContext
:param exchange_connection: Optional name of the connection to use for token exchange. If None, default connection will be used.
:type exchange_connection: Optional[str], optional
:type exchange_connection: Optional[str], Optional
:param exchange_scopes: Optional list of scopes to request during token exchange. If None, default scopes will be used.
:type exchange_scopes: Optional[list[str]], optional
:type exchange_scopes: Optional[list[str]], Optional
"""
raise NotImplementedError()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ async def get_refreshed_token(
:param context: The turn context for the current turn of conversation.
:type context: TurnContext
:param exchange_connection: Optional name of the connection to use for token exchange. If None, default connection will be used.
:type exchange_connection: Optional[str], optional
:type exchange_connection: Optional[str], Optional
:param exchange_scopes: Optional list of scopes to request during token exchange. If None, default scopes will be used.
:type exchange_scopes: Optional[list[str]], optional
:type exchange_scopes: Optional[list[str]], Optional
"""
flow, _ = await self._load_flow(context)
input_token_response = await flow.get_user_token()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(
:param connection_manager: The connection manager for OAuth providers.
:type connection_manager: Connections
:param auth_handlers: Configuration for OAuth providers.
:type auth_handlers: dict[str, AuthHandler], optional
:type auth_handlers: dict[str, AuthHandler], Optional
:raises ValueError: When storage is None or no auth handlers provided.
"""
super().__init__(
Expand Down Expand Up @@ -172,9 +172,9 @@ async def get_refreshed_token(
:param context: The turn context for the current turn of conversation.
:type context: TurnContext
:param exchange_connection: Optional name of the connection to use for token exchange. If None, default connection will be used.
:type exchange_connection: Optional[str], optional
:type exchange_connection: Optional[str], Optional
:param exchange_scopes: Optional list of scopes to request during token exchange. If None, default scopes will be used.
:type exchange_scopes: Optional[list[str]], optional
:type exchange_scopes: Optional[list[str]], Optional
"""
if not exchange_scopes:
exchange_scopes = self._handler.scopes or []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(
:param connection_manager: The connection manager for OAuth providers.
:type connection_manager: Connections
:param auth_handlers: Configuration for OAuth providers.
:type auth_handlers: dict[str, AuthHandler], optional
:type auth_handlers: dict[str, AuthHandler], Optional
:raises ValueError: When storage is None or no auth handlers provided.
"""
if not storage:
Expand Down