microsoft-agents-hosting-core 0.10.0.dev5__tar.gz → 0.10.0.dev7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {microsoft_agents_hosting_core-0.10.0.dev5/microsoft_agents_hosting_core.egg-info → microsoft_agents_hosting_core-0.10.0.dev7}/PKG-INFO +2 -2
- microsoft_agents_hosting_core-0.10.0.dev7/VERSION.txt +1 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +2 -2
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/__init__.py +3 -1
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/agent_application.py +51 -43
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/app_options.py +8 -0
- microsoft_agents_hosting_core-0.10.0.dev7/microsoft_agents/hosting/core/app/typing_indicator.py +243 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7/microsoft_agents_hosting_core.egg-info}/PKG-INFO +2 -2
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -1
- microsoft_agents_hosting_core-0.10.0.dev5/VERSION.txt +0 -1
- microsoft_agents_hosting_core-0.10.0.dev5/microsoft_agents/hosting/core/app/typing_indicator.py +0 -81
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/LICENSE +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/MANIFEST.in +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/activity_handler.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/agent.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/_type_defs.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/app_error.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/input_file.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/authorization.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/oauth/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/proactive/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/proactive/conversation.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/proactive/conversation_builder.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/proactive/proactive.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/proactive/proactive_options.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/query.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/state/state.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/app/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/authorization/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/card_factory.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/channel_service_adapter.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/telemetry/_request_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/telemetry/connector_spans.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/http/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/http/_http_adapter_base.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/http/_http_response.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/message_factory.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/middleware_set.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/state/user_state.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/storage.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/transcript_file_store.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/transcript_info.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/transcript_logger.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/transcript_memory_store.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/storage/transcript_store.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/adapter/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/adapter/constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/adapter/metrics.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/adapter/spans.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/attributes.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/core/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/core/base_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/core/resource.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/core/simple_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/core/type_defs.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/turn_context/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/turn_context/constants.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/turn_context/spans.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/telemetry/utils.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents/hosting/core/turn_context.py +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/pyproject.toml +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/readme.md +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/setup.cfg +0 -0
- {microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-core
|
|
3
|
-
Version: 0.10.0.
|
|
3
|
+
Version: 0.10.0.dev7
|
|
4
4
|
Summary: Core library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: microsoft-agents-activity==0.10.0.
|
|
18
|
+
Requires-Dist: microsoft-agents-activity==0.10.0.dev7
|
|
19
19
|
Requires-Dist: pyjwt>=2.10.1
|
|
20
20
|
Requires-Dist: isodate>=0.6.1
|
|
21
21
|
Requires-Dist: azure-core>=1.30.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.10.0.dev7
|
|
@@ -187,7 +187,7 @@ class _OAuthFlow:
|
|
|
187
187
|
|
|
188
188
|
token_exchange_state = TokenExchangeState(
|
|
189
189
|
connection_name=self._abs_oauth_connection_name,
|
|
190
|
-
conversation=activity.get_conversation_reference(),
|
|
190
|
+
conversation=activity.get_conversation_reference(force_base_channel=True),
|
|
191
191
|
relates_to=activity.relates_to,
|
|
192
192
|
ms_app_id=self._ms_app_id,
|
|
193
193
|
)
|
|
@@ -195,7 +195,7 @@ class _OAuthFlow:
|
|
|
195
195
|
res = await self._user_token_client.user_token._get_token_or_sign_in_resource(
|
|
196
196
|
activity.from_property.id,
|
|
197
197
|
self._abs_oauth_connection_name,
|
|
198
|
-
|
|
198
|
+
token_exchange_state.conversation.channel_id,
|
|
199
199
|
token_exchange_state.get_encoded_state(),
|
|
200
200
|
)
|
|
201
201
|
|
|
@@ -11,7 +11,7 @@ from .app_options import ApplicationOptions
|
|
|
11
11
|
from .input_file import InputFile, InputFileDownloader
|
|
12
12
|
from .query import Query
|
|
13
13
|
from ._routes import _RouteList, _Route, RouteRank
|
|
14
|
-
from .typing_indicator import TypingIndicator
|
|
14
|
+
from .typing_indicator import TypingChannelStrategy, TypingIndicator, TypingOptions
|
|
15
15
|
from ._type_defs import RouteHandler, RouteSelector, StateT
|
|
16
16
|
|
|
17
17
|
# Auth
|
|
@@ -46,7 +46,9 @@ __all__ = [
|
|
|
46
46
|
"Query",
|
|
47
47
|
"Route",
|
|
48
48
|
"RouteHandler",
|
|
49
|
+
"TypingChannelStrategy",
|
|
49
50
|
"TypingIndicator",
|
|
51
|
+
"TypingOptions",
|
|
50
52
|
"StatePropertyAccessor",
|
|
51
53
|
"ConversationState",
|
|
52
54
|
"state",
|
|
@@ -5,6 +5,7 @@ Licensed under the MIT License.
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
import logging
|
|
8
|
+
from contextlib import nullcontext
|
|
8
9
|
from copy import copy
|
|
9
10
|
from functools import partial
|
|
10
11
|
|
|
@@ -697,62 +698,69 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
697
698
|
await self._start_long_running_call(context, self._on_turn)
|
|
698
699
|
|
|
699
700
|
async def _on_turn(self, context: TurnContext):
|
|
700
|
-
typing = None
|
|
701
701
|
try:
|
|
702
702
|
with spans.AppOnTurn(context) as on_turn_span:
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
):
|
|
703
|
+
use_typing = (
|
|
704
|
+
self._options.start_typing_timer
|
|
705
|
+
and context.activity.type != ActivityTypes.typing
|
|
706
|
+
)
|
|
707
|
+
typing_context = (
|
|
708
|
+
TypingIndicator(
|
|
709
|
+
context,
|
|
710
|
+
typing_options=self._options.typing,
|
|
711
|
+
)
|
|
712
|
+
if use_typing
|
|
713
|
+
else nullcontext()
|
|
714
|
+
)
|
|
716
715
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
716
|
+
async with typing_context:
|
|
717
|
+
self._remove_mentions(context)
|
|
718
|
+
|
|
719
|
+
logger.debug("Initializing turn state")
|
|
720
|
+
turn_state = await self._initialize_state(context)
|
|
721
|
+
if context.activity.type in [
|
|
722
|
+
ActivityTypes.message,
|
|
723
|
+
ActivityTypes.invoke,
|
|
724
|
+
]:
|
|
725
|
+
|
|
726
|
+
(
|
|
727
|
+
auth_intercepts,
|
|
728
|
+
continuation_activity,
|
|
729
|
+
) = await self._auth._on_turn_auth_intercept(
|
|
730
|
+
context, turn_state
|
|
731
|
+
)
|
|
732
|
+
if auth_intercepts:
|
|
733
|
+
if continuation_activity:
|
|
734
|
+
new_context = copy(context)
|
|
735
|
+
new_context.activity = continuation_activity
|
|
736
|
+
logger.info(
|
|
737
|
+
"Resending continuation activity %s",
|
|
738
|
+
continuation_activity.text,
|
|
739
|
+
)
|
|
740
|
+
await self.on_turn(new_context)
|
|
741
|
+
await turn_state.save(context)
|
|
742
|
+
return
|
|
743
|
+
|
|
744
|
+
logger.debug("Running before turn middleware")
|
|
745
|
+
if not await self._run_before_turn_middleware(context, turn_state):
|
|
731
746
|
return
|
|
732
747
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
return
|
|
748
|
+
logger.debug("Running file downloads")
|
|
749
|
+
await self._handle_file_downloads(context, turn_state)
|
|
736
750
|
|
|
737
|
-
|
|
738
|
-
|
|
751
|
+
logger.debug("Running activity handlers")
|
|
752
|
+
await self._on_activity(context, turn_state, on_turn_span)
|
|
739
753
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
if await self._run_after_turn_middleware(context, turn_state):
|
|
745
|
-
await turn_state.save(context)
|
|
746
|
-
return
|
|
754
|
+
logger.debug("Running after turn middleware")
|
|
755
|
+
if await self._run_after_turn_middleware(context, turn_state):
|
|
756
|
+
await turn_state.save(context)
|
|
757
|
+
return
|
|
747
758
|
except ApplicationError as err:
|
|
748
759
|
logger.error(
|
|
749
760
|
f"An application error occurred in the AgentApplication: {err}",
|
|
750
761
|
exc_info=True,
|
|
751
762
|
)
|
|
752
763
|
await self._on_error(context, err)
|
|
753
|
-
finally:
|
|
754
|
-
if typing:
|
|
755
|
-
typing.stop()
|
|
756
764
|
|
|
757
765
|
def _remove_mentions(self, context: TurnContext):
|
|
758
766
|
if (
|
|
@@ -13,6 +13,7 @@ from microsoft_agents.hosting.core.app.oauth import AuthHandler
|
|
|
13
13
|
from microsoft_agents.hosting.core.storage import Storage
|
|
14
14
|
|
|
15
15
|
# from .auth import AuthOptions
|
|
16
|
+
from .typing_indicator import TypingOptions
|
|
16
17
|
from .input_file import InputFileDownloader
|
|
17
18
|
from ..channel_service_adapter import ChannelServiceAdapter
|
|
18
19
|
|
|
@@ -62,6 +63,13 @@ class ApplicationOptions:
|
|
|
62
63
|
the request. Defaults to true.
|
|
63
64
|
"""
|
|
64
65
|
|
|
66
|
+
typing: Optional[TypingOptions] = None
|
|
67
|
+
"""
|
|
68
|
+
Optional. Typing indicator timing options. Controls initial delay, interval,
|
|
69
|
+
and per-channel strategies. If not provided, defaults are used when
|
|
70
|
+
``start_typing_timer`` is true.
|
|
71
|
+
"""
|
|
72
|
+
|
|
65
73
|
long_running_messages: bool = False
|
|
66
74
|
"""
|
|
67
75
|
Optional. If true, the bot supports long running messages that can take longer then the 10 - 15
|
microsoft_agents_hosting_core-0.10.0.dev7/microsoft_agents/hosting/core/app/typing_indicator.py
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the MIT License.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import asyncio
|
|
9
|
+
import logging
|
|
10
|
+
from dataclasses import dataclass, field
|
|
11
|
+
from typing import Dict, Optional
|
|
12
|
+
|
|
13
|
+
from microsoft_agents.hosting.core import TurnContext
|
|
14
|
+
from microsoft_agents.activity import Activity, ActivityTypes, Channels, EntityTypes
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
DEFAULT_INITIAL_DELAY_MS = 500
|
|
19
|
+
DEFAULT_INTERVAL_MS = 10000
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass
|
|
23
|
+
class TypingChannelStrategy:
|
|
24
|
+
"""Per-channel timing parameters for the typing indicator.
|
|
25
|
+
|
|
26
|
+
:param initial_delay_ms: Delay in milliseconds before the first typing activity.
|
|
27
|
+
:param interval_ms: Interval in milliseconds between subsequent typing activities.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
initial_delay_ms: int = DEFAULT_INITIAL_DELAY_MS
|
|
31
|
+
interval_ms: int = DEFAULT_INTERVAL_MS
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass
|
|
35
|
+
class TypingOptions:
|
|
36
|
+
"""Configuration options for the automatic typing indicator.
|
|
37
|
+
|
|
38
|
+
:param initial_delay_ms: Default delay in milliseconds before the first typing activity.
|
|
39
|
+
:param interval_ms: Default interval in milliseconds between subsequent typing activities.
|
|
40
|
+
:param channel_strategies: Optional per-channel timing overrides keyed by channel ID.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
initial_delay_ms: int = DEFAULT_INITIAL_DELAY_MS
|
|
44
|
+
interval_ms: int = DEFAULT_INTERVAL_MS
|
|
45
|
+
channel_strategies: Dict[str, TypingChannelStrategy] = field(default_factory=dict)
|
|
46
|
+
|
|
47
|
+
def __post_init__(self):
|
|
48
|
+
# Apply default channel overrides (matching .NET's M365Copilot default)
|
|
49
|
+
if Channels.copilot_studio.value not in self.channel_strategies:
|
|
50
|
+
# make a copy to avoid mutating input
|
|
51
|
+
self.channel_strategies = dict(self.channel_strategies)
|
|
52
|
+
self.channel_strategies[Channels.copilot_studio.value] = (
|
|
53
|
+
TypingChannelStrategy(initial_delay_ms=250, interval_ms=1000)
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
def get_strategy_for_channel(self, channel: str) -> TypingChannelStrategy:
|
|
57
|
+
"""Returns the timing strategy for the given channel, falling back to defaults."""
|
|
58
|
+
if channel in self.channel_strategies:
|
|
59
|
+
return self.channel_strategies[channel]
|
|
60
|
+
return TypingChannelStrategy(
|
|
61
|
+
initial_delay_ms=self.initial_delay_ms,
|
|
62
|
+
interval_ms=self.interval_ms,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class TypingIndicator:
|
|
67
|
+
"""
|
|
68
|
+
Encapsulates the logic for sending "typing" activity to the user.
|
|
69
|
+
|
|
70
|
+
Scoped to a single turn of conversation with the user.
|
|
71
|
+
|
|
72
|
+
Automatically stops when a message or streaming activity is about to be
|
|
73
|
+
sent on the same turn, preventing bare typing activities from overlapping
|
|
74
|
+
with real responses.
|
|
75
|
+
|
|
76
|
+
Can be used as an async context manager::
|
|
77
|
+
|
|
78
|
+
async with TypingIndicator(context, typing_options=opts) as typing:
|
|
79
|
+
# typing indicators are sent automatically
|
|
80
|
+
...
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
def __init__(
|
|
84
|
+
self,
|
|
85
|
+
context: TurnContext,
|
|
86
|
+
interval_seconds: Optional[float] = None,
|
|
87
|
+
typing_options: Optional[TypingOptions] = None,
|
|
88
|
+
) -> None:
|
|
89
|
+
"""Initializes a new instance of the TypingIndicator class.
|
|
90
|
+
|
|
91
|
+
:param context: The turn context.
|
|
92
|
+
:param interval_seconds: Interval in seconds between typing indicators.
|
|
93
|
+
When set, overrides the interval from ``typing_options``.
|
|
94
|
+
:param typing_options: Typing timing options including per-channel
|
|
95
|
+
strategies. If not provided, defaults are used. An explicit
|
|
96
|
+
``interval_seconds`` value takes precedence over the interval
|
|
97
|
+
in ``typing_options`` for backward compatibility.
|
|
98
|
+
"""
|
|
99
|
+
options = typing_options or TypingOptions()
|
|
100
|
+
|
|
101
|
+
channel = (
|
|
102
|
+
context.activity.channel_id.channel if context.activity.channel_id else ""
|
|
103
|
+
) or ""
|
|
104
|
+
strategy = options.get_strategy_for_channel(channel)
|
|
105
|
+
|
|
106
|
+
interval = (
|
|
107
|
+
interval_seconds
|
|
108
|
+
if interval_seconds is not None
|
|
109
|
+
else strategy.interval_ms / 1000.0
|
|
110
|
+
)
|
|
111
|
+
initial_delay = strategy.initial_delay_ms / 1000.0
|
|
112
|
+
|
|
113
|
+
if interval <= 0:
|
|
114
|
+
raise ValueError("interval must be greater than 0")
|
|
115
|
+
|
|
116
|
+
if initial_delay < 0:
|
|
117
|
+
raise ValueError("initial_delay must be greater than or equal to 0")
|
|
118
|
+
|
|
119
|
+
self._context: TurnContext = context
|
|
120
|
+
self._interval: float = interval
|
|
121
|
+
self._initial_delay: float = initial_delay
|
|
122
|
+
self._task: Optional[asyncio.Task[None]] = None
|
|
123
|
+
self._last_send: Optional[asyncio.Task[None]] = None
|
|
124
|
+
self._stopped: bool = False
|
|
125
|
+
self._hook_registered: bool = False
|
|
126
|
+
|
|
127
|
+
async def __aenter__(self) -> "TypingIndicator":
|
|
128
|
+
self.start()
|
|
129
|
+
return self
|
|
130
|
+
|
|
131
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
|
|
132
|
+
await self._stop_async()
|
|
133
|
+
|
|
134
|
+
async def _send_typing(self) -> None:
|
|
135
|
+
"""Sends a single typing activity via the adapter, bypassing middleware."""
|
|
136
|
+
ref = self._context.activity.get_conversation_reference()
|
|
137
|
+
typing_activity = TurnContext.apply_conversation_reference(
|
|
138
|
+
Activity(type=ActivityTypes.typing), ref
|
|
139
|
+
)
|
|
140
|
+
await self._context.adapter.send_activities(self._context, [typing_activity])
|
|
141
|
+
|
|
142
|
+
async def _run(self) -> None:
|
|
143
|
+
"""Sends typing indicators at regular intervals after an initial delay."""
|
|
144
|
+
try:
|
|
145
|
+
if self._initial_delay > 0:
|
|
146
|
+
await asyncio.sleep(self._initial_delay)
|
|
147
|
+
|
|
148
|
+
while not self._stopped:
|
|
149
|
+
send_task = asyncio.ensure_future(self._send_typing())
|
|
150
|
+
self._last_send = send_task
|
|
151
|
+
# Shield the send so task cancellation doesn't interrupt
|
|
152
|
+
# an in-flight adapter call.
|
|
153
|
+
try:
|
|
154
|
+
await asyncio.shield(send_task)
|
|
155
|
+
except asyncio.CancelledError:
|
|
156
|
+
# Task was cancelled while sending — wait for the send
|
|
157
|
+
# to finish naturally, then exit the loop.
|
|
158
|
+
break
|
|
159
|
+
await asyncio.sleep(self._interval)
|
|
160
|
+
except asyncio.CancelledError:
|
|
161
|
+
pass
|
|
162
|
+
except Exception:
|
|
163
|
+
logger.debug(
|
|
164
|
+
"Typing indicator send failed for conversation %s",
|
|
165
|
+
self._context.activity.conversation.id,
|
|
166
|
+
exc_info=True,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
@staticmethod
|
|
170
|
+
def _has_streaminfo(activity: Activity) -> bool:
|
|
171
|
+
"""Check if an activity contains a streaminfo entity."""
|
|
172
|
+
if not activity.entities:
|
|
173
|
+
return False
|
|
174
|
+
for entity in activity.entities:
|
|
175
|
+
entity_type = getattr(entity, "type", None)
|
|
176
|
+
if entity_type is None and isinstance(entity, dict):
|
|
177
|
+
entity_type = entity.get("type")
|
|
178
|
+
if entity_type == EntityTypes.STREAM_INFO.value:
|
|
179
|
+
return True
|
|
180
|
+
return False
|
|
181
|
+
|
|
182
|
+
def start(self) -> None:
|
|
183
|
+
"""Starts sending typing indicators and registers a send-activity hook
|
|
184
|
+
that auto-stops the indicator when a real response is about to be sent."""
|
|
185
|
+
|
|
186
|
+
if self._task is not None:
|
|
187
|
+
logger.warning(
|
|
188
|
+
"Typing indicator is already running for conversation %s",
|
|
189
|
+
self._context.activity.conversation.id,
|
|
190
|
+
)
|
|
191
|
+
return
|
|
192
|
+
|
|
193
|
+
logger.debug(
|
|
194
|
+
"Starting typing indicator (initial_delay=%.1fs, interval=%.1fs) "
|
|
195
|
+
"for conversation %s",
|
|
196
|
+
self._initial_delay,
|
|
197
|
+
self._interval,
|
|
198
|
+
self._context.activity.conversation.id,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
self._stopped = False
|
|
202
|
+
self._task = asyncio.create_task(self._run())
|
|
203
|
+
|
|
204
|
+
if not self._hook_registered:
|
|
205
|
+
|
|
206
|
+
async def _on_send_activities_handler(ctx, activities, next_handler):
|
|
207
|
+
should_stop = any(
|
|
208
|
+
a.type == ActivityTypes.message or self._has_streaminfo(a)
|
|
209
|
+
for a in activities
|
|
210
|
+
)
|
|
211
|
+
if should_stop:
|
|
212
|
+
self._stop_loop()
|
|
213
|
+
return await next_handler()
|
|
214
|
+
|
|
215
|
+
self._context.on_send_activities(_on_send_activities_handler)
|
|
216
|
+
self._hook_registered = True
|
|
217
|
+
|
|
218
|
+
def _stop_loop(self) -> None:
|
|
219
|
+
"""Cancels the background loop task. Does not await in-flight sends."""
|
|
220
|
+
if self._stopped:
|
|
221
|
+
return
|
|
222
|
+
self._stopped = True
|
|
223
|
+
|
|
224
|
+
if self._task is not None:
|
|
225
|
+
self._task.cancel()
|
|
226
|
+
self._task = None
|
|
227
|
+
|
|
228
|
+
def stop(self) -> None:
|
|
229
|
+
"""Stops sending typing indicators synchronously."""
|
|
230
|
+
self._stop_loop()
|
|
231
|
+
|
|
232
|
+
async def _stop_async(self) -> None:
|
|
233
|
+
"""Stops typing and waits for any in-flight send to finish."""
|
|
234
|
+
self._stop_loop()
|
|
235
|
+
|
|
236
|
+
# Wait for any in-flight typing send to finish so we don't
|
|
237
|
+
# interrupt an adapter call mid-flight.
|
|
238
|
+
if self._last_send and not self._last_send.done():
|
|
239
|
+
try:
|
|
240
|
+
await asyncio.shield(self._last_send)
|
|
241
|
+
except (asyncio.CancelledError, Exception):
|
|
242
|
+
pass
|
|
243
|
+
self._last_send = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-core
|
|
3
|
-
Version: 0.10.0.
|
|
3
|
+
Version: 0.10.0.dev7
|
|
4
4
|
Summary: Core library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: microsoft-agents-activity==0.10.0.
|
|
18
|
+
Requires-Dist: microsoft-agents-activity==0.10.0.dev7
|
|
19
19
|
Requires-Dist: pyjwt>=2.10.1
|
|
20
20
|
Requires-Dist: isodate>=0.6.1
|
|
21
21
|
Requires-Dist: azure-core>=1.30.0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.10.0.dev5
|
microsoft_agents_hosting_core-0.10.0.dev5/microsoft_agents/hosting/core/app/typing_indicator.py
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
Licensed under the MIT License.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
from __future__ import annotations
|
|
7
|
-
|
|
8
|
-
import asyncio
|
|
9
|
-
import logging
|
|
10
|
-
from typing import Optional
|
|
11
|
-
|
|
12
|
-
from microsoft_agents.hosting.core import TurnContext
|
|
13
|
-
from microsoft_agents.activity import Activity, ActivityTypes
|
|
14
|
-
|
|
15
|
-
logger = logging.getLogger(__name__)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class TypingIndicator:
|
|
19
|
-
"""
|
|
20
|
-
Encapsulates the logic for sending "typing" activity to the user.
|
|
21
|
-
|
|
22
|
-
Scoped to a single turn of conversation with the user.
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
def __init__(self, context: TurnContext, interval_seconds: float = 10.0) -> None:
|
|
26
|
-
"""Initializes a new instance of the TypingIndicator class.
|
|
27
|
-
|
|
28
|
-
:param context: The turn context.
|
|
29
|
-
:param interval_seconds: The interval in seconds between typing indicators.
|
|
30
|
-
"""
|
|
31
|
-
if interval_seconds <= 0:
|
|
32
|
-
raise ValueError("interval_seconds must be greater than 0")
|
|
33
|
-
self._context: TurnContext = context
|
|
34
|
-
self._interval: float = interval_seconds
|
|
35
|
-
self._task: Optional[asyncio.Task[None]] = None
|
|
36
|
-
|
|
37
|
-
async def _run(self) -> None:
|
|
38
|
-
"""Sends typing indicators at regular intervals."""
|
|
39
|
-
|
|
40
|
-
running_task = self._task
|
|
41
|
-
try:
|
|
42
|
-
while running_task is self._task:
|
|
43
|
-
await self._context.send_activity(Activity(type=ActivityTypes.typing))
|
|
44
|
-
await asyncio.sleep(self._interval)
|
|
45
|
-
except asyncio.CancelledError:
|
|
46
|
-
# Task was cancelled, exit gracefully
|
|
47
|
-
pass
|
|
48
|
-
|
|
49
|
-
def start(self) -> None:
|
|
50
|
-
"""Starts sending typing indicators."""
|
|
51
|
-
|
|
52
|
-
if self._task is not None:
|
|
53
|
-
logger.warning(
|
|
54
|
-
"Typing indicator is already running for conversation %s",
|
|
55
|
-
self._context.activity.conversation.id,
|
|
56
|
-
)
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
logger.debug(
|
|
60
|
-
"Starting typing indicator with interval: %s seconds in conversation %s",
|
|
61
|
-
self._interval,
|
|
62
|
-
self._context.activity.conversation.id,
|
|
63
|
-
)
|
|
64
|
-
self._task = asyncio.create_task(self._run())
|
|
65
|
-
|
|
66
|
-
def stop(self) -> None:
|
|
67
|
-
"""Stops sending typing indicators."""
|
|
68
|
-
|
|
69
|
-
if self._task is None:
|
|
70
|
-
logger.warning(
|
|
71
|
-
"Typing indicator is not running for conversation %s",
|
|
72
|
-
self._context.activity.conversation.id,
|
|
73
|
-
)
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
logger.debug(
|
|
77
|
-
"Stopping typing indicator for conversation %s",
|
|
78
|
-
self._context.activity.conversation.id,
|
|
79
|
-
)
|
|
80
|
-
self._task.cancel()
|
|
81
|
-
self._task = None
|
{microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/LICENSE
RENAMED
|
File without changes
|
{microsoft_agents_hosting_core-0.10.0.dev5 → microsoft_agents_hosting_core-0.10.0.dev7}/MANIFEST.in
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|