microsoft-agents-hosting-core 0.10.0.dev6__tar.gz → 0.10.0.dev8__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.
Files changed (169) hide show
  1. {microsoft_agents_hosting_core-0.10.0.dev6/microsoft_agents_hosting_core.egg-info → microsoft_agents_hosting_core-0.10.0.dev8}/PKG-INFO +2 -2
  2. microsoft_agents_hosting_core-0.10.0.dev8/VERSION.txt +1 -0
  3. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/__init__.py +3 -1
  4. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/agent_application.py +51 -43
  5. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/app_options.py +8 -0
  6. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/proactive/proactive.py +61 -44
  7. microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/app/proactive/telemetry/constants.py +9 -0
  8. microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/app/proactive/telemetry/spans.py +142 -0
  9. microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/app/typing_indicator.py +243 -0
  10. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/attributes.py +3 -0
  11. microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/telemetry/turn_context/__init__.py +0 -0
  12. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents_hosting_core.egg-info}/PKG-INFO +2 -2
  13. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +3 -0
  14. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -1
  15. microsoft_agents_hosting_core-0.10.0.dev6/VERSION.txt +0 -1
  16. microsoft_agents_hosting_core-0.10.0.dev6/microsoft_agents/hosting/core/app/typing_indicator.py +0 -81
  17. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/LICENSE +0 -0
  18. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/MANIFEST.in +0 -0
  19. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/__init__.py +0 -0
  20. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
  21. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
  22. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
  23. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
  24. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/activity_handler.py +0 -0
  25. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/agent.py +0 -0
  26. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
  27. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
  28. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
  29. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
  30. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/_type_defs.py +0 -0
  31. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/app_error.py +0 -0
  32. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/input_file.py +0 -0
  33. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
  34. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
  35. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
  36. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
  37. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
  38. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +0 -0
  39. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
  40. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
  41. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
  42. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/authorization.py +0 -0
  43. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/telemetry/__init__.py +0 -0
  44. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py +0 -0
  45. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/oauth/telemetry/spans.py +0 -0
  46. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/proactive/__init__.py +0 -0
  47. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/proactive/conversation.py +0 -0
  48. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/proactive/conversation_builder.py +0 -0
  49. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py +0 -0
  50. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py +0 -0
  51. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/proactive/proactive_options.py +0 -0
  52. {microsoft_agents_hosting_core-0.10.0.dev6/microsoft_agents/hosting/core/app → microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/app/proactive}/telemetry/__init__.py +0 -0
  53. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/query.py +0 -0
  54. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
  55. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
  56. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/state/state.py +0 -0
  57. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
  58. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
  59. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
  60. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
  61. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
  62. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +0 -0
  63. {microsoft_agents_hosting_core-0.10.0.dev6/microsoft_agents/hosting/core/authorization → microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/app}/telemetry/__init__.py +0 -0
  64. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/telemetry/constants.py +0 -0
  65. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/telemetry/metrics.py +0 -0
  66. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/app/telemetry/spans.py +0 -0
  67. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
  68. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +0 -0
  69. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -0
  70. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +0 -0
  71. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
  72. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
  73. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
  74. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
  75. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +0 -0
  76. {microsoft_agents_hosting_core-0.10.0.dev6/microsoft_agents/hosting/core/connector → microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/authorization}/telemetry/__init__.py +0 -0
  77. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/telemetry/constants.py +0 -0
  78. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/telemetry/metrics.py +0 -0
  79. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/authorization/telemetry/spans.py +0 -0
  80. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/card_factory.py +0 -0
  81. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
  82. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
  83. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/channel_service_adapter.py +0 -0
  84. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
  85. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/__init__.py +0 -0
  86. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
  87. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
  88. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
  89. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
  90. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
  91. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
  92. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
  93. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
  94. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
  95. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
  96. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
  97. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
  98. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
  99. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
  100. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
  101. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
  102. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
  103. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
  104. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
  105. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
  106. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
  107. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
  108. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
  109. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +0 -0
  110. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
  111. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
  112. {microsoft_agents_hosting_core-0.10.0.dev6/microsoft_agents/hosting/core/storage → microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/connector}/telemetry/__init__.py +0 -0
  113. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/_request_span_wrapper.py +0 -0
  114. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/connector_spans.py +0 -0
  115. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/constants.py +0 -0
  116. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/metrics.py +0 -0
  117. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py +0 -0
  118. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
  119. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
  120. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
  121. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
  122. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/http/__init__.py +0 -0
  123. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -0
  124. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/http/_http_adapter_base.py +0 -0
  125. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -0
  126. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/http/_http_response.py +0 -0
  127. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/message_factory.py +0 -0
  128. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/middleware_set.py +0 -0
  129. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
  130. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/state/__init__.py +0 -0
  131. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
  132. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
  133. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/state/user_state.py +0 -0
  134. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
  135. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
  136. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
  137. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
  138. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/storage.py +0 -0
  139. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
  140. {microsoft_agents_hosting_core-0.10.0.dev6/microsoft_agents/hosting/core/telemetry/adapter → microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/storage/telemetry}/__init__.py +0 -0
  141. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/telemetry/constants.py +0 -0
  142. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/telemetry/metrics.py +0 -0
  143. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/telemetry/spans.py +0 -0
  144. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/transcript_file_store.py +0 -0
  145. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/transcript_info.py +0 -0
  146. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/transcript_logger.py +0 -0
  147. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/transcript_memory_store.py +0 -0
  148. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/storage/transcript_store.py +0 -0
  149. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/__init__.py +0 -0
  150. {microsoft_agents_hosting_core-0.10.0.dev6/microsoft_agents/hosting/core/telemetry/turn_context → microsoft_agents_hosting_core-0.10.0.dev8/microsoft_agents/hosting/core/telemetry/adapter}/__init__.py +0 -0
  151. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/adapter/constants.py +0 -0
  152. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/adapter/metrics.py +0 -0
  153. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/adapter/spans.py +0 -0
  154. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/core/__init__.py +0 -0
  155. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py +0 -0
  156. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/core/base_span_wrapper.py +0 -0
  157. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/core/resource.py +0 -0
  158. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/core/simple_span_wrapper.py +0 -0
  159. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/core/type_defs.py +0 -0
  160. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/turn_context/constants.py +0 -0
  161. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/turn_context/spans.py +0 -0
  162. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/telemetry/utils.py +0 -0
  163. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents/hosting/core/turn_context.py +0 -0
  164. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
  165. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
  166. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/pyproject.toml +0 -0
  167. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/readme.md +0 -0
  168. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/setup.cfg +0 -0
  169. {microsoft_agents_hosting_core-0.10.0.dev6 → microsoft_agents_hosting_core-0.10.0.dev8}/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.dev6
3
+ Version: 0.10.0.dev8
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.dev6
18
+ Requires-Dist: microsoft-agents-activity==0.10.0.dev8
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.dev8
@@ -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
- if context.activity.type != ActivityTypes.typing:
704
- if self._options.start_typing_timer:
705
- typing = TypingIndicator(context)
706
- typing.start()
707
-
708
- self._remove_mentions(context)
709
-
710
- logger.debug("Initializing turn state")
711
- turn_state = await self._initialize_state(context)
712
- if (
713
- context.activity.type == ActivityTypes.message
714
- or context.activity.type == ActivityTypes.invoke
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
- auth_intercepts,
719
- continuation_activity,
720
- ) = await self._auth._on_turn_auth_intercept(context, turn_state)
721
- if auth_intercepts:
722
- if continuation_activity:
723
- new_context = copy(context)
724
- new_context.activity = continuation_activity
725
- logger.info(
726
- "Resending continuation activity %s",
727
- continuation_activity.text,
728
- )
729
- await self.on_turn(new_context)
730
- await turn_state.save(context)
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
- logger.debug("Running before turn middleware")
734
- if not await self._run_before_turn_middleware(context, turn_state):
735
- return
748
+ logger.debug("Running file downloads")
749
+ await self._handle_file_downloads(context, turn_state)
736
750
 
737
- logger.debug("Running file downloads")
738
- await self._handle_file_downloads(context, turn_state)
751
+ logger.debug("Running activity handlers")
752
+ await self._on_activity(context, turn_state, on_turn_span)
739
753
 
740
- logger.debug("Running activity handlers")
741
- await self._on_activity(context, turn_state, on_turn_span)
742
-
743
- logger.debug("Running after turn middleware")
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
@@ -16,6 +16,7 @@ from microsoft_agents.hosting.core.storage import Storage
16
16
  from .conversation import Conversation
17
17
  from .create_conversation_options import CreateConversationOptions
18
18
  from .proactive_options import ProactiveOptions
19
+ from .telemetry import spans
19
20
 
20
21
  if TYPE_CHECKING:
21
22
  from microsoft_agents.hosting.core.turn_context import TurnContext
@@ -95,7 +96,7 @@ class Proactive(Generic[StateT]):
95
96
 
96
97
  async def store_conversation(
97
98
  self,
98
- context_or_conversation: "TurnContext | Conversation",
99
+ context_or_conversation: TurnContext | Conversation,
99
100
  ) -> None:
100
101
  """
101
102
  Persist a :class:`~microsoft_agents.hosting.core.app.proactive.conversation.Conversation`
@@ -120,10 +121,13 @@ class Proactive(Generic[StateT]):
120
121
  else:
121
122
  conversation = context_or_conversation
122
123
 
123
- conversation.validate()
124
- key = self._storage_key(conversation.conversation_reference.conversation.id)
125
- logger.debug("Storing conversation with key: %s", key)
126
- await self._storage.write({key: conversation})
124
+ with spans.ProactiveStoreConversation(
125
+ conversation.conversation_reference.conversation.id
126
+ ):
127
+ conversation.validate()
128
+ key = self._storage_key(conversation.conversation_reference.conversation.id)
129
+ logger.debug("Storing conversation with key: %s", key)
130
+ await self._storage.write({key: conversation})
127
131
 
128
132
  async def get_conversation(self, conversation_id: str) -> Optional[Conversation]:
129
133
  """
@@ -136,9 +140,12 @@ class Proactive(Generic[StateT]):
136
140
  or ``None`` if not found.
137
141
  :rtype: Optional[:class:`~microsoft_agents.hosting.core.app.proactive.conversation.Conversation`]
138
142
  """
139
- key = self._storage_key(conversation_id)
140
- results = await self._storage.read([key], target_cls=Conversation)
141
- return results.get(key)
143
+ with spans.ProactiveGetConversation(conversation_id) as span:
144
+ key = self._storage_key(conversation_id)
145
+ results = await self._storage.read([key], target_cls=Conversation)
146
+ conversation = results.get(key)
147
+ span.share(found=conversation is not None)
148
+ return conversation
142
149
 
143
150
  async def delete_conversation(self, conversation_id: str) -> None:
144
151
  """
@@ -147,9 +154,10 @@ class Proactive(Generic[StateT]):
147
154
  :param conversation_id: The conversation ID to delete.
148
155
  :type conversation_id: str
149
156
  """
150
- key = self._storage_key(conversation_id)
151
- logger.debug("Deleting conversation with key: %s", key)
152
- await self._storage.delete([key])
157
+ with spans.ProactiveDeleteConversation(conversation_id):
158
+ key = self._storage_key(conversation_id)
159
+ logger.debug("Deleting conversation with key: %s", key)
160
+ await self._storage.delete([key])
153
161
 
154
162
  # ------------------------------------------------------------------
155
163
  # Send a single activity
@@ -181,7 +189,9 @@ class Proactive(Generic[StateT]):
181
189
  conversation is not found in storage.
182
190
  """
183
191
  conversation = await self._resolve_conversation(conversation_id_or_conversation)
184
- return await Proactive._send_activity_impl(adapter, conversation, activity)
192
+ conversation_id = conversation.conversation_reference.conversation.id
193
+ with spans.ProactiveSendActivity(conversation_id, activity):
194
+ return await Proactive._send_activity_impl(adapter, conversation, activity)
185
195
 
186
196
  @staticmethod
187
197
  async def _send_activity_impl(
@@ -252,6 +262,7 @@ class Proactive(Generic[StateT]):
252
262
  :attr:`~ProactiveOptions.fail_on_unsigned_in_connections` is ``True``.
253
263
  """
254
264
  conversation = await self._resolve_conversation(conversation_id_or_conversation)
265
+ conversation_id = conversation.conversation_reference.conversation.id
255
266
 
256
267
  captured_exc: Optional[BaseException] = None
257
268
  claims = Conversation.identity_from_claims(conversation.claims)
@@ -267,10 +278,14 @@ class Proactive(Generic[StateT]):
267
278
  except Exception as exc: # noqa: BLE001
268
279
  captured_exc = exc
269
280
 
270
- await adapter.continue_conversation_with_claims(claims, continuation, _callback)
281
+ with spans.ProactiveContinueConversation(conversation_id, continuation):
271
282
 
272
- if captured_exc is not None:
273
- raise captured_exc
283
+ await adapter.continue_conversation_with_claims(
284
+ claims, continuation, _callback
285
+ )
286
+
287
+ if captured_exc is not None:
288
+ raise captured_exc
274
289
 
275
290
  # ------------------------------------------------------------------
276
291
  # Create a new conversation
@@ -303,40 +318,42 @@ class Proactive(Generic[StateT]):
303
318
  new_conversation: Optional[Conversation] = None
304
319
  captured_exc: Optional[BaseException] = None
305
320
 
306
- audience = options.audience or options.identity.get_token_audience()
321
+ with spans.ProactiveCreateConversation(options):
307
322
 
308
- async def _callback(context: "TurnContext") -> None:
309
- nonlocal new_conversation, captured_exc
310
- try:
311
- reference = context.activity.get_conversation_reference()
312
- new_conversation = Conversation(
313
- claims=options.identity,
314
- conversation_reference=reference,
315
- )
323
+ audience = options.audience or options.identity.get_token_audience()
316
324
 
317
- if options.store_conversation:
318
- await self.store_conversation(new_conversation)
319
-
320
- if handler is not None:
321
- state = await self._load_state(context)
322
- await handler(context, state)
323
- await state.save(context)
324
- except Exception as exc: # noqa: BLE001
325
- captured_exc = exc
325
+ async def _callback(context: "TurnContext") -> None:
326
+ nonlocal new_conversation, captured_exc
327
+ try:
328
+ reference = context.activity.get_conversation_reference()
329
+ new_conversation = Conversation(
330
+ claims=options.identity,
331
+ conversation_reference=reference,
332
+ )
326
333
 
327
- await adapter.create_conversation(
328
- options.identity.get_app_id() or "",
329
- options.channel_id,
330
- options.service_url,
331
- audience,
332
- options.parameters,
333
- _callback,
334
- )
334
+ if options.store_conversation:
335
+ await self.store_conversation(new_conversation)
336
+
337
+ if handler is not None:
338
+ state = await self._load_state(context)
339
+ await handler(context, state)
340
+ await state.save(context)
341
+ except Exception as exc: # noqa: BLE001
342
+ captured_exc = exc
343
+
344
+ await adapter.create_conversation(
345
+ options.identity.get_app_id() or "",
346
+ options.channel_id,
347
+ options.service_url,
348
+ audience,
349
+ options.parameters,
350
+ _callback,
351
+ )
335
352
 
336
- if captured_exc is not None:
337
- raise captured_exc
353
+ if captured_exc is not None:
354
+ raise captured_exc
338
355
 
339
- return new_conversation
356
+ return new_conversation
340
357
 
341
358
  # ------------------------------------------------------------------
342
359
  # Internal helpers
@@ -0,0 +1,9 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ SPAN_STORE_CONVERSATION = "agents.proactive.store_conversation"
5
+ SPAN_GET_CONVERSATION = "agents.proactive.get_conversation"
6
+ SPAN_DELETE_CONVERSATION = "agents.proactive.delete_conversation"
7
+ SPAN_SEND_ACTIVITY = "agents.proactive.send_activity"
8
+ SPAN_CONTINUE_CONVERSATION = "agents.proactive.continue_conversation"
9
+ SPAN_CREATE_CONVERSATION = "agents.proactive.create_conversation"
@@ -0,0 +1,142 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ from __future__ import annotations
5
+
6
+ from microsoft_agents.activity import Activity
7
+ from microsoft_agents.hosting.core.telemetry import (
8
+ AttributeMap,
9
+ attributes,
10
+ SimpleSpanWrapper,
11
+ )
12
+ from . import constants
13
+ from ..create_conversation_options import CreateConversationOptions
14
+
15
+
16
+ class ProactiveStoreConversation(SimpleSpanWrapper):
17
+ """Span for storing a conversation reference in proactive scenarios, starting from when the store operation is initiated until it is completed. This span can be used to correlate telemetry related to storing conversation references in proactive scenarios."""
18
+
19
+ def __init__(self, conversation_id: str):
20
+ """Initializes the ProactiveStoreConversation SpanWrapper.
21
+
22
+ :param conversation_id: The ID of the conversation being stored, used to extract attributes for the span
23
+ """
24
+ super().__init__(constants.SPAN_STORE_CONVERSATION)
25
+ self._conversation_id = conversation_id
26
+
27
+ def _get_attributes(self) -> AttributeMap:
28
+ return {
29
+ attributes.CONVERSATION_ID: self._conversation_id or attributes.UNKNOWN,
30
+ }
31
+
32
+
33
+ class ProactiveGetConversation(SimpleSpanWrapper):
34
+ """Span for getting a conversation reference in proactive scenarios."""
35
+
36
+ def __init__(self, conversation_id: str):
37
+ """Initializes the ProactiveGetConversation SpanWrapper.
38
+
39
+ :param conversation_id: The ID of the conversation being retrieved, used to extract attributes for the span
40
+ """
41
+ super().__init__(constants.SPAN_GET_CONVERSATION)
42
+ self._conversation_id = conversation_id
43
+ self._found: bool | None = None
44
+
45
+ def _get_attributes(self) -> AttributeMap:
46
+ return {
47
+ attributes.CONVERSATION_ID: self._conversation_id or attributes.UNKNOWN,
48
+ attributes.CONVERSATION_FOUND: (
49
+ self._found if self._found is not None else attributes.UNKNOWN
50
+ ),
51
+ }
52
+
53
+ def share(self, found: bool) -> None:
54
+ """Records to the span whether the conversation being retrieved was found.
55
+
56
+ :param found: Whether the conversation being retrieved was found
57
+ """
58
+ self._found = found
59
+
60
+
61
+ class ProactiveDeleteConversation(SimpleSpanWrapper):
62
+ """Span for deleting a conversation reference in proactive scenarios, starting from when the delete operation is initiated until it is completed. This span can be used to correlate telemetry related to deleting conversation references in proactive scenarios."""
63
+
64
+ def __init__(self, conversation_id: str):
65
+ """Initializes the ProactiveDeleteConversation SpanWrapper.
66
+
67
+ :param conversation_id: The ID of the conversation being deleted, used to extract attributes for the span
68
+ """
69
+ super().__init__(constants.SPAN_DELETE_CONVERSATION)
70
+ self._conversation_id = conversation_id
71
+
72
+ def _get_attributes(self) -> AttributeMap:
73
+ return {
74
+ attributes.CONVERSATION_ID: self._conversation_id or attributes.UNKNOWN,
75
+ }
76
+
77
+
78
+ class ProactiveSendActivity(SimpleSpanWrapper):
79
+ """Span for sending an activity in proactive scenarios, starting from when the send operation is initiated until it is completed. This span can be used to correlate telemetry related to sending activities in proactive scenarios."""
80
+
81
+ def __init__(self, conversation_id: str, activity: Activity):
82
+ """Initializes the ProactiveSendActivity SpanWrapper.
83
+
84
+ :param conversation_id: The ID of the conversation the activity is being sent to, used to extract attributes for the span
85
+ :param activity: The activity being sent, used to extract attributes for the span
86
+ """
87
+ super().__init__(constants.SPAN_SEND_ACTIVITY)
88
+ self._conversation_id = conversation_id
89
+ self._activity = activity
90
+
91
+ def _get_attributes(self) -> AttributeMap:
92
+ return {
93
+ attributes.CONVERSATION_ID: self._conversation_id or attributes.UNKNOWN,
94
+ attributes.ACTIVITY_TYPE: self._activity.type or attributes.UNKNOWN,
95
+ attributes.ACTIVITY_CHANNEL_ID: self._activity.channel_id
96
+ or attributes.UNKNOWN,
97
+ }
98
+
99
+
100
+ class ProactiveContinueConversation(SimpleSpanWrapper):
101
+ """Span for continuing a conversation in proactive scenarios, starting from when the continue operation is initiated until it is completed. This span can be used to correlate telemetry related to continuing conversations in proactive scenarios."""
102
+
103
+ def __init__(self, conversation_id: str, activity: Activity):
104
+ """Initializes the ProactiveContinueConversation SpanWrapper.
105
+
106
+ :param conversation_id: The ID of the conversation being continued, used to extract attributes for the span
107
+ :param activity: The activity being sent, used to extract attributes for the span
108
+ """
109
+ super().__init__(constants.SPAN_CONTINUE_CONVERSATION)
110
+ self._conversation_id = conversation_id
111
+ self._activity = activity
112
+
113
+ def _get_attributes(self) -> AttributeMap:
114
+ return {
115
+ attributes.CONVERSATION_ID: self._conversation_id or attributes.UNKNOWN,
116
+ attributes.ACTIVITY_TYPE: self._activity.type or attributes.UNKNOWN,
117
+ attributes.ACTIVITY_CHANNEL_ID: self._activity.channel_id
118
+ or attributes.UNKNOWN,
119
+ }
120
+
121
+
122
+ class ProactiveCreateConversation(SimpleSpanWrapper):
123
+ """Span for creating a conversation in proactive scenarios, starting from when the create operation is initiated until it is completed. This span can be used to correlate telemetry related to creating conversations in proactive scenarios."""
124
+
125
+ def __init__(self, options: CreateConversationOptions):
126
+ """Initializes the ProactiveCreateConversation SpanWrapper.
127
+
128
+ :param options: The options used to create the conversation, used to extract attributes for the span
129
+ """
130
+ super().__init__(constants.SPAN_CREATE_CONVERSATION)
131
+ self._channel_id = options.channel_id
132
+ self._members_count: str | int = (
133
+ len(options.parameters.members)
134
+ if options.parameters and options.parameters.members
135
+ else attributes.UNKNOWN
136
+ )
137
+
138
+ def _get_attributes(self) -> AttributeMap:
139
+ return {
140
+ attributes.ACTIVITY_CHANNEL_ID: self._channel_id,
141
+ attributes.MEMBERS_COUNT: self._members_count,
142
+ }