microsoft-agents-activity 1.10.0.dev0__tar.gz → 1.10.0.dev2__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_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/PKG-INFO +1 -1
- microsoft_agents_activity-1.10.0.dev2/VERSION.txt +1 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/__init__.py +39 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_coercion.py +281 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_configuration_protocol.py +35 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_constants.py +5 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/config/_load_configuration.py +1 -1
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_logging/__init__.py +12 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_logging/_color_formatter.py +42 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_logging/_constants.py +20 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_logging/_load.py +38 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_logging/_logging_configuration.py +57 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_resolve.py +96 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_utils.py +366 -0
- microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/configuration.py +431 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents_activity.egg-info/PKG-INFO +1 -1
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents_activity.egg-info/SOURCES.txt +10 -1
- microsoft_agents_activity-1.10.0.dev0/VERSION.txt +0 -1
- microsoft_agents_activity-1.10.0.dev0/microsoft_agents/activity/config/__init__.py +0 -8
- microsoft_agents_activity-1.10.0.dev0/microsoft_agents/activity/config/_coercion.py +0 -99
- microsoft_agents_activity-1.10.0.dev0/microsoft_agents/activity/config/_configure_logging.py +0 -92
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/LICENSE +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/MANIFEST.in +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/__init__.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/_model_utils.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/_type_aliases.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/_utils/__init__.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/_utils/_deferred_string.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/action_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/activity.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/activity_event_names.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/activity_importance.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/activity_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/adaptive_card_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/adaptive_card_invoke_action.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/adaptive_card_invoke_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/adaptive_card_invoke_value.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/adaptive_card_search_invoke_value.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/agents_model.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/animation_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/attachment.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/attachment_data.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/attachment_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/attachment_layout_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/attachment_view.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/audio_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/caller_id_constants.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/card_action.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/card_image.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/channel_account.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/channel_adapter_protocol.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/channel_id.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/channels.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/contact_relation_update_action_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/content_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/conversation_account.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/conversation_members.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/conversation_parameters.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/conversation_reference.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/conversation_resource_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/conversation_update_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/conversations_result.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/delivery_modes.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/end_of_conversation_codes.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/__init__.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/_schema_mixin.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/_validate_known_entities.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/activity_treatment.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/ai_entity.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/entity.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/entity_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/geo_coordinates.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/mention.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/place.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/product_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/stream_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/entity/thing.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/error.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/error_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/errors/__init__.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/errors/error_message.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/errors/error_resources.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/expected_replies.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/fact.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/hero_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/inner_http_error.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/input_hints.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/installation_update_action_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/invoke_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/media_event_value.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/media_url.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/message_reaction.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/message_reaction_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/message_update_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/oauth_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/paged_members_result.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/py.typed +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/receipt_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/receipt_item.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/resource_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/role_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/search_invoke_options.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/search_invoke_value.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/semantic_action.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/semantic_actions_states.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/sign_in_constants.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/sign_in_resource.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/signin_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/suggested_actions.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/__init__.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/app_based_link_query.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/batch_failed_entries_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/batch_failed_entry.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/batch_operation_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/batch_operation_state_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/bot_config_auth.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/cache_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/cancel_operation_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/channel_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/config_auth_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/config_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/config_response_base.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/config_task_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/conversation_list.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/file_consent_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/file_consent_card_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/file_download_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/file_info_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/file_upload_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_details.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_details_base.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_end_event_details.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_event_details.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_notification.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_notification_base.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_notification_channel_data.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_notification_recipient_failure_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_notification_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_participant_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_participants_event_details.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_stage_surface.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_start_event_details.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/meeting_tab_icon_surface.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload_app.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload_attachment.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload_body.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload_conversation.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload_from.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload_mention.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload_reaction.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/message_actions_payload_user.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_action.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_action_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_attachment.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_parameter.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_query.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_query_options.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_result.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/messaging_extension_suggested_action.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/notification_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_action_base.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_action_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_action_query.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_date_input.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_fact.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_http_post.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_image.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_input_base.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_multichoice_input.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_multichoice_input_choice.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_open_uri.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_open_uri_target.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_section.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_text_input.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/o365_connector_card_view_action.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/on_behalf_of.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/read_receipt_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/signin_state_verification_query.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/surface.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_context.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_entity_context.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_request.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_response_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_response_cards.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_response_payload.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_submit.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_submit_data.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tab_suggested_actions.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/targeted_meeting_notification.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/targeted_meeting_notification_value.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/task_module_card_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/task_module_continue_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/task_module_message_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/task_module_request.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/task_module_request_context.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/task_module_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/task_module_response_base.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/task_module_task_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/team_details.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/team_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_batch_operation_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_channel_account.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_channel_data.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_channel_data_settings.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_meeting_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_meeting_member.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_meeting_participant.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_member.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/teams_paged_members_result.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/tenant_info.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/teams/user_meeting_details.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/text_format_types.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/text_highlight.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/thumbnail_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/thumbnail_url.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_exchange_invoke_request.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_exchange_invoke_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_exchange_request.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_exchange_resource.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_exchange_state.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_or_sign_in_resource_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_post_resource.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_request.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_response.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/token_status.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/transcript.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/turn_context_protocol.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents/activity/video_card.py +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents_activity.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents_activity.egg-info/requires.txt +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/microsoft_agents_activity.egg-info/top_level.txt +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/pyproject.toml +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/readme.md +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/setup.cfg +0 -0
- {microsoft_agents_activity-1.10.0.dev0 → microsoft_agents_activity-1.10.0.dev2}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.10.0.dev2
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from ._load_configuration import load_configuration_from_env
|
|
5
|
+
from .configuration import Configuration, _Configurable
|
|
6
|
+
from ._configuration_protocol import _ConfigurationProtocol, _DictConfigurable
|
|
7
|
+
from ._resolve import _resolve
|
|
8
|
+
from ._utils import (
|
|
9
|
+
_MissingType,
|
|
10
|
+
_MISSING,
|
|
11
|
+
_get,
|
|
12
|
+
_is_missing,
|
|
13
|
+
_path as path,
|
|
14
|
+
_xpath as xpath,
|
|
15
|
+
_set,
|
|
16
|
+
_try_set,
|
|
17
|
+
)
|
|
18
|
+
from ._coercion import coerce_bool, coerce_int, coerce_float, _get_str
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"load_configuration_from_env",
|
|
22
|
+
"Configuration",
|
|
23
|
+
"_ConfigurationProtocol",
|
|
24
|
+
"_MissingType",
|
|
25
|
+
"_MISSING",
|
|
26
|
+
"_is_missing",
|
|
27
|
+
"xpath",
|
|
28
|
+
"path",
|
|
29
|
+
"_get",
|
|
30
|
+
"_set",
|
|
31
|
+
"_try_set",
|
|
32
|
+
"_resolve",
|
|
33
|
+
"_Configurable",
|
|
34
|
+
"_DictConfigurable",
|
|
35
|
+
"coerce_bool",
|
|
36
|
+
"coerce_int",
|
|
37
|
+
"coerce_float",
|
|
38
|
+
"_get_str",
|
|
39
|
+
]
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
"""Coercion helpers for values loaded from environment configuration.
|
|
5
|
+
|
|
6
|
+
:func:`load_configuration_from_env` keeps every value as the raw string (or a
|
|
7
|
+
nested ``dict``) read from the environment. Consumers that expect a bool, int or
|
|
8
|
+
float must coerce explicitly: a naive ``bool("false")`` is ``True`` and would
|
|
9
|
+
silently invert a flag, and ``int("5") + 1`` style math fails on values that may
|
|
10
|
+
legitimately arrive as strings. These helpers centralize that coercion so every
|
|
11
|
+
config consumer parses env values the same, fail-safe way.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
from typing import (
|
|
17
|
+
Any,
|
|
18
|
+
Mapping,
|
|
19
|
+
overload,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
from ._utils import (
|
|
23
|
+
_MISSING,
|
|
24
|
+
_MissingType,
|
|
25
|
+
_get,
|
|
26
|
+
_is_missing,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
_TRUTHY = ("1", "true")
|
|
30
|
+
_FALSY = ("0", "false")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@overload
|
|
34
|
+
def _handle_bool(
|
|
35
|
+
value: Any, default: None = None, name: str = "value"
|
|
36
|
+
) -> bool | None: ...
|
|
37
|
+
@overload
|
|
38
|
+
def _handle_bool(
|
|
39
|
+
value: Any, default: bool | _MissingType = _MISSING, name: str = "value"
|
|
40
|
+
) -> bool: ...
|
|
41
|
+
def _handle_bool(
|
|
42
|
+
value: Any, default: bool | None | _MissingType = None, name: str = "value"
|
|
43
|
+
) -> bool | None:
|
|
44
|
+
"""Coerce a config value (possibly an env string) to a bool.
|
|
45
|
+
|
|
46
|
+
Environment variables always arrive as strings, so ``bool("false")`` would
|
|
47
|
+
be ``True``. Recognized truthy spellings are ``1/true`` and falsy spellings
|
|
48
|
+
are ``0/false`` (case-insensitive).
|
|
49
|
+
|
|
50
|
+
An empty/whitespace-only string or ``None`` is treated as *unset* (not as an
|
|
51
|
+
explicit ``false``). Unset values return the default, or raise if no default
|
|
52
|
+
was supplied. Unrecognized nonempty values always raise ``ValueError``.
|
|
53
|
+
Errors identify the setting without including its input value.
|
|
54
|
+
"""
|
|
55
|
+
if isinstance(value, bool):
|
|
56
|
+
return value
|
|
57
|
+
if isinstance(value, (int, float)):
|
|
58
|
+
return bool(value)
|
|
59
|
+
if value is not None and not _is_missing(value):
|
|
60
|
+
text = str(value).strip().lower()
|
|
61
|
+
if text in _TRUTHY:
|
|
62
|
+
return True
|
|
63
|
+
if text in _FALSY:
|
|
64
|
+
return False
|
|
65
|
+
if text:
|
|
66
|
+
raise ValueError(f"Invalid boolean for {name}")
|
|
67
|
+
if _is_missing(default):
|
|
68
|
+
raise ValueError(f"Missing boolean for {name}")
|
|
69
|
+
return default
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def coerce_bool(value: Any, default: bool | None = None, name: str = "value") -> bool:
|
|
73
|
+
"""Coerce a config value (possibly an env string) to a bool.
|
|
74
|
+
|
|
75
|
+
Environment variables always arrive as strings, so ``bool("false")`` would
|
|
76
|
+
be ``True``. Recognized truthy spellings are ``1/true`` and falsy spellings
|
|
77
|
+
are ``0/false`` (case-insensitive).
|
|
78
|
+
|
|
79
|
+
An empty/whitespace-only string or ``None`` is treated as *unset* (not as an
|
|
80
|
+
explicit ``false``). Unset and unrecognized values return the default, or
|
|
81
|
+
raise ``ValueError`` if no non-None default was supplied.
|
|
82
|
+
Errors identify the setting without including its input value.
|
|
83
|
+
"""
|
|
84
|
+
new_default = default if default is not None else _MISSING
|
|
85
|
+
try:
|
|
86
|
+
return _handle_bool(value, new_default, name)
|
|
87
|
+
except ValueError:
|
|
88
|
+
if default is not None:
|
|
89
|
+
return default
|
|
90
|
+
raise
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@overload
|
|
94
|
+
def _handle_int(
|
|
95
|
+
value: Any, default: int | _MissingType = _MISSING, name: str = "value"
|
|
96
|
+
) -> int: ...
|
|
97
|
+
@overload
|
|
98
|
+
def _handle_int(
|
|
99
|
+
value: Any, default: None = None, name: str = "value"
|
|
100
|
+
) -> int | None: ...
|
|
101
|
+
def _handle_int(
|
|
102
|
+
value: Any, default: int | None | _MissingType = None, name: str = "value"
|
|
103
|
+
) -> int | None:
|
|
104
|
+
"""Coerce a config value (possibly an env string) to an int.
|
|
105
|
+
|
|
106
|
+
Empty/``None`` values fall back to ``default``. Bools are treated as unset
|
|
107
|
+
(a stray ``True``/``False`` is not a meaningful count). Numeric strings such
|
|
108
|
+
as ``"5"`` or ``"5.0"`` are accepted; anything else raises ``ValueError``
|
|
109
|
+
naming the offending setting.
|
|
110
|
+
"""
|
|
111
|
+
if value is None or _is_missing(value):
|
|
112
|
+
if _is_missing(default):
|
|
113
|
+
raise ValueError(f"Missing integer for {name}")
|
|
114
|
+
return default
|
|
115
|
+
if isinstance(value, bool):
|
|
116
|
+
if _is_missing(default):
|
|
117
|
+
raise ValueError(f"Missing integer for {name}")
|
|
118
|
+
return default # TODO -> should this raise?
|
|
119
|
+
if isinstance(value, int):
|
|
120
|
+
return value
|
|
121
|
+
text = str(value).strip()
|
|
122
|
+
if not text:
|
|
123
|
+
if _is_missing(default):
|
|
124
|
+
raise ValueError(f"Missing integer for {name}")
|
|
125
|
+
return default
|
|
126
|
+
try:
|
|
127
|
+
return int(text, 10)
|
|
128
|
+
except ValueError:
|
|
129
|
+
try:
|
|
130
|
+
return int(float(text))
|
|
131
|
+
except ValueError:
|
|
132
|
+
raise ValueError(f"Invalid integer for {name}") from None
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def coerce_int(value: Any, default: int | None = None, name: str = "value") -> int:
|
|
136
|
+
"""Coerce a config value (possibly an env string) to an int.
|
|
137
|
+
|
|
138
|
+
Empty/``None`` values fall back to ``default``. Bools are treated as unset
|
|
139
|
+
(a stray ``True``/``False`` is not a meaningful count). Numeric strings such
|
|
140
|
+
as ``"5"`` or ``"5.0"`` are accepted; anything else raises ``ValueError``
|
|
141
|
+
naming the offending setting.
|
|
142
|
+
"""
|
|
143
|
+
new_default = default if default is not None else _MISSING
|
|
144
|
+
return _handle_int(value, new_default, name)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
@overload
|
|
148
|
+
def _handle_float(
|
|
149
|
+
value: Any, default: float | _MissingType, name: str = "value"
|
|
150
|
+
) -> float: ...
|
|
151
|
+
@overload
|
|
152
|
+
def _handle_float(
|
|
153
|
+
value: Any, default: None = None, name: str = "value"
|
|
154
|
+
) -> float | None: ...
|
|
155
|
+
def _handle_float(
|
|
156
|
+
value: Any, default: float | None | _MissingType = None, name: str = "value"
|
|
157
|
+
) -> float | None:
|
|
158
|
+
"""Coerce a config value (possibly an env string) to a float.
|
|
159
|
+
|
|
160
|
+
Empty/``None`` values fall back to ``default``. Bools are treated as unset.
|
|
161
|
+
Anything that is not parseable as a float raises ``ValueError`` naming the
|
|
162
|
+
offending setting.
|
|
163
|
+
"""
|
|
164
|
+
if value is None or _is_missing(value):
|
|
165
|
+
if _is_missing(default):
|
|
166
|
+
raise ValueError(f"Missing number for {name}")
|
|
167
|
+
return default
|
|
168
|
+
if isinstance(value, bool):
|
|
169
|
+
if _is_missing(default):
|
|
170
|
+
raise ValueError(f"Missing number for {name}")
|
|
171
|
+
return default # TODO -> should this also raise?
|
|
172
|
+
if isinstance(value, (int, float)):
|
|
173
|
+
return float(value)
|
|
174
|
+
text = str(value).strip()
|
|
175
|
+
if not text:
|
|
176
|
+
if _is_missing(default):
|
|
177
|
+
raise ValueError(f"Missing number for {name}")
|
|
178
|
+
return default
|
|
179
|
+
try:
|
|
180
|
+
return float(text)
|
|
181
|
+
except ValueError:
|
|
182
|
+
raise ValueError(f"Invalid number for {name}") from None
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def coerce_float(
|
|
186
|
+
value: Any, default: float | None = None, name: str = "value"
|
|
187
|
+
) -> float:
|
|
188
|
+
"""Coerce a config value (possibly an env string) to a float.
|
|
189
|
+
|
|
190
|
+
Empty/``None`` values fall back to ``default``. Bools are treated as unset.
|
|
191
|
+
Anything that is not parseable as a float raises ``ValueError`` naming the
|
|
192
|
+
offending setting.
|
|
193
|
+
"""
|
|
194
|
+
new_default = default if default is not None else _MISSING
|
|
195
|
+
return _handle_float(value, new_default, name)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _check_key_error(value: Any, default: Any, key: str) -> None:
|
|
199
|
+
if _is_missing(value) and _is_missing(default):
|
|
200
|
+
raise KeyError(key)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
@overload
|
|
204
|
+
def _handle_str(
|
|
205
|
+
value: Any, default: None = None, name: str = "value"
|
|
206
|
+
) -> str | None: ...
|
|
207
|
+
@overload
|
|
208
|
+
def _handle_str(
|
|
209
|
+
value: Any, default: str | _MissingType = _MISSING, name: str = "value"
|
|
210
|
+
) -> str: ...
|
|
211
|
+
def _handle_str(
|
|
212
|
+
value: Any, default: str | None | _MissingType = None, name: str = "value"
|
|
213
|
+
) -> str | None:
|
|
214
|
+
if value is None or _is_missing(value):
|
|
215
|
+
if _is_missing(default):
|
|
216
|
+
raise ValueError(f"Missing string for {name}")
|
|
217
|
+
return default
|
|
218
|
+
if isinstance(value, str):
|
|
219
|
+
return value
|
|
220
|
+
return str(value)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def _handle_str_list(
|
|
224
|
+
value: Any, default: list[str] | None = None, name: str = "value"
|
|
225
|
+
) -> list[str]:
|
|
226
|
+
if not isinstance(value, list):
|
|
227
|
+
raise ValueError(f"{name} must be a list.")
|
|
228
|
+
values = [_handle_str(val) for val in value]
|
|
229
|
+
return [val for val in values if val is not None]
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
@overload
|
|
233
|
+
def _get_bool(mapping: Mapping, key: str, default: bool | _MissingType) -> bool: ...
|
|
234
|
+
@overload
|
|
235
|
+
def _get_bool(mapping: Mapping, key: str, default: None) -> bool | None: ...
|
|
236
|
+
def _get_bool(
|
|
237
|
+
mapping: Mapping, key: str, default: bool | None | _MissingType = _MISSING
|
|
238
|
+
) -> bool | None:
|
|
239
|
+
val = _get(mapping, key, default=_MISSING)
|
|
240
|
+
_check_key_error(val, default, key)
|
|
241
|
+
return _handle_bool(val, default, key)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
@overload
|
|
245
|
+
def _get_int(mapping: Mapping, key: str, default: int | _MissingType) -> int: ...
|
|
246
|
+
@overload
|
|
247
|
+
def _get_int(mapping: Mapping, key: str, default: None) -> int | None: ...
|
|
248
|
+
def _get_int(
|
|
249
|
+
mapping: Mapping, key: str, default: int | None | _MissingType = _MISSING
|
|
250
|
+
) -> int | None:
|
|
251
|
+
val = _get(mapping, key, default=_MISSING)
|
|
252
|
+
_check_key_error(val, default, key)
|
|
253
|
+
return _handle_int(val, default, key)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
@overload
|
|
257
|
+
def _get_float(mapping: Mapping, *key: str, default: float | _MissingType) -> float: ...
|
|
258
|
+
@overload
|
|
259
|
+
def _get_float(mapping: Mapping, *key: str, default: None) -> float | None: ...
|
|
260
|
+
def _get_float(
|
|
261
|
+
mapping: Mapping, *key: str, default: float | None | _MissingType = _MISSING
|
|
262
|
+
) -> float | None:
|
|
263
|
+
if not key:
|
|
264
|
+
raise ValueError("At least one key must be provided.")
|
|
265
|
+
val = _get(mapping, *key, default=_MISSING)
|
|
266
|
+
_check_key_error(val, default, key[0])
|
|
267
|
+
return _handle_float(val, default, key[0])
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
@overload
|
|
271
|
+
def _get_str(mapping: Mapping, *key: str, default: str | _MissingType) -> str: ...
|
|
272
|
+
@overload
|
|
273
|
+
def _get_str(mapping: Mapping, *key: str, default: None) -> str | None: ...
|
|
274
|
+
def _get_str(
|
|
275
|
+
mapping: Mapping, *key: str, default: str | None | _MissingType = _MISSING
|
|
276
|
+
) -> str | None:
|
|
277
|
+
if not key:
|
|
278
|
+
raise ValueError("At least one key must be provided.")
|
|
279
|
+
val = _get(mapping, *key, default=_MISSING)
|
|
280
|
+
_check_key_error(val, default, key[0])
|
|
281
|
+
return _handle_str(val, default, key[0])
|
microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_configuration_protocol.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from abc import ABC, abstractmethod
|
|
5
|
+
from typing import (
|
|
6
|
+
Mapping,
|
|
7
|
+
Protocol,
|
|
8
|
+
runtime_checkable,
|
|
9
|
+
)
|
|
10
|
+
from typing_extensions import Self
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@runtime_checkable
|
|
14
|
+
class _ConfigurationProtocol(Protocol):
|
|
15
|
+
|
|
16
|
+
@classmethod
|
|
17
|
+
def from_mapping(cls, _mapping: Mapping) -> Self: ...
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class _DictConfigurableProtocol(_ConfigurationProtocol, Protocol):
|
|
21
|
+
|
|
22
|
+
def __init__(self, data: dict, *args, **kwargs) -> None: ...
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def from_mapping(cls, mapping: Mapping) -> Self: ...
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _DictConfigurable(ABC):
|
|
29
|
+
|
|
30
|
+
@abstractmethod
|
|
31
|
+
def __init__(self, data: dict, *args, **kwargs) -> None: ...
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_mapping(cls, mapping: Mapping) -> Self:
|
|
35
|
+
return cls(dict(mapping))
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from ._color_formatter import ColorFormatter
|
|
5
|
+
from ._load import _configure_logging
|
|
6
|
+
from ._logging_configuration import _LoggingConfiguration
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"ColorFormatter",
|
|
10
|
+
"_configure_logging",
|
|
11
|
+
"_LoggingConfiguration",
|
|
12
|
+
]
|
microsoft_agents_activity-1.10.0.dev2/microsoft_agents/activity/config/_logging/_color_formatter.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import logging
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ColorFormatter(logging.Formatter):
|
|
8
|
+
"""Logging formatter that can add ANSI color based on severity."""
|
|
9
|
+
|
|
10
|
+
MAGENTA = "\033[1;35m"
|
|
11
|
+
RED = "\033[1;31m"
|
|
12
|
+
YELLOW = "\033[1;33m"
|
|
13
|
+
GREEN = "\033[1;32m"
|
|
14
|
+
BLUE = "\033[1;34m"
|
|
15
|
+
RESET = "\033[0m"
|
|
16
|
+
|
|
17
|
+
FMT = (
|
|
18
|
+
"%(asctime)s - %(name)s - %(levelname)s - %(message)s (%(filename)s:%(lineno)d)"
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
use_colors: bool = True,
|
|
24
|
+
) -> None:
|
|
25
|
+
super().__init__(fmt=self.FMT)
|
|
26
|
+
self._plain_formatter = logging.Formatter(fmt=self.FMT)
|
|
27
|
+
if not use_colors:
|
|
28
|
+
self._formatters: dict[int, logging.Formatter] = {}
|
|
29
|
+
return
|
|
30
|
+
self._formatters = {
|
|
31
|
+
logging.CRITICAL: logging.Formatter(
|
|
32
|
+
f"{self.MAGENTA}{self.FMT}{self.RESET}"
|
|
33
|
+
),
|
|
34
|
+
logging.ERROR: logging.Formatter(f"{self.RED}{self.FMT}{self.RESET}"),
|
|
35
|
+
logging.WARNING: logging.Formatter(f"{self.YELLOW}{self.FMT}{self.RESET}"),
|
|
36
|
+
logging.INFO: logging.Formatter(f"{self.GREEN}{self.FMT}{self.RESET}"),
|
|
37
|
+
logging.DEBUG: logging.Formatter(f"{self.BLUE}{self.FMT}{self.RESET}"),
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
def format(self, record: logging.LogRecord) -> str:
|
|
41
|
+
formatter = self._formatters.get(record.levelno)
|
|
42
|
+
return (formatter or self._plain_formatter).format(record)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import logging
|
|
5
|
+
|
|
6
|
+
# in Python 3.11, we can move to using
|
|
7
|
+
# logging.getLevelNamesMapping()
|
|
8
|
+
_NAME_TO_LEVEL = {
|
|
9
|
+
"CRITICAL": logging.CRITICAL,
|
|
10
|
+
"FATAL": logging.FATAL,
|
|
11
|
+
"ERROR": logging.ERROR,
|
|
12
|
+
"WARN": logging.WARNING,
|
|
13
|
+
"WARNING": logging.WARNING,
|
|
14
|
+
"INFO": logging.INFO,
|
|
15
|
+
"INFORMATION": logging.INFO, # .NET parity
|
|
16
|
+
"DEBUG": logging.DEBUG,
|
|
17
|
+
"NOTSET": logging.NOTSET,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
_DEFAULT_NAMESPACE = "default"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import logging
|
|
5
|
+
from typing import Mapping
|
|
6
|
+
|
|
7
|
+
from ..configuration import Configuration
|
|
8
|
+
from ._logging_configuration import _LoggingConfiguration
|
|
9
|
+
from ._color_formatter import ColorFormatter
|
|
10
|
+
from ._constants import _DEFAULT_NAMESPACE
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _configure_logging(_config: Mapping | Configuration | _LoggingConfiguration):
|
|
14
|
+
"""Configures logging based on the provided logging configuration dictionary.
|
|
15
|
+
|
|
16
|
+
:param config: A Configuration object or _LoggingConfiguration instance containing logging configuration.
|
|
17
|
+
:raises ValueError: If an invalid log level is provided in the configuration.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
if isinstance(_config, Mapping):
|
|
21
|
+
config = _LoggingConfiguration.from_mapping(_config)
|
|
22
|
+
else:
|
|
23
|
+
config = _LoggingConfiguration.from_configuration(_config)
|
|
24
|
+
|
|
25
|
+
console_handler = logging.StreamHandler()
|
|
26
|
+
console_handler.setFormatter(
|
|
27
|
+
ColorFormatter(use_colors=console_handler.stream.isatty())
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
for entry in config.log_levels:
|
|
31
|
+
if entry.namespace == _DEFAULT_NAMESPACE:
|
|
32
|
+
logger = logging.getLogger()
|
|
33
|
+
else:
|
|
34
|
+
logger = logging.getLogger(entry.namespace)
|
|
35
|
+
logger.propagate = False # Prevent log messages from being propagated
|
|
36
|
+
logger.handlers.clear() # Remove existing handlers to prevent duplicates
|
|
37
|
+
logger.addHandler(console_handler)
|
|
38
|
+
logger.setLevel(entry.level)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
# Licensed under the MIT License.
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import Mapping
|
|
10
|
+
|
|
11
|
+
from microsoft_agents.activity.errors import configuration_errors
|
|
12
|
+
|
|
13
|
+
from ..configuration import Configuration, _Configurable
|
|
14
|
+
from .._utils import _xpath
|
|
15
|
+
from ._constants import _NAME_TO_LEVEL
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass(frozen=True)
|
|
19
|
+
class _LogLevelEntry:
|
|
20
|
+
"""Represents a logging level entry with a namespace and level."""
|
|
21
|
+
|
|
22
|
+
namespace: str
|
|
23
|
+
level: int
|
|
24
|
+
|
|
25
|
+
def __init__(self, namespace: str, level: str) -> None:
|
|
26
|
+
level_upper = level.upper()
|
|
27
|
+
if level_upper not in _NAME_TO_LEVEL:
|
|
28
|
+
raise ValueError(
|
|
29
|
+
configuration_errors.InvalidLoggingConfiguration.format(
|
|
30
|
+
namespace, level
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
object.__setattr__(self, "namespace", namespace.lower())
|
|
34
|
+
object.__setattr__(self, "level", _NAME_TO_LEVEL[level_upper])
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass(frozen=True)
|
|
38
|
+
class _LoggingConfiguration(_Configurable):
|
|
39
|
+
"""Configuration class for logging levels."""
|
|
40
|
+
|
|
41
|
+
log_levels: list[_LogLevelEntry]
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def _from_configuration(cls, config: Configuration) -> _LoggingConfiguration:
|
|
45
|
+
|
|
46
|
+
raw_log_levels = config.get(_xpath("log_level"), default={})
|
|
47
|
+
if not isinstance(raw_log_levels, Mapping):
|
|
48
|
+
raise ValueError(
|
|
49
|
+
configuration_errors.InvalidLoggingConfiguration.format(
|
|
50
|
+
"log_levels", raw_log_levels
|
|
51
|
+
)
|
|
52
|
+
)
|
|
53
|
+
log_levels: list[_LogLevelEntry] = [
|
|
54
|
+
_LogLevelEntry(namespace, level)
|
|
55
|
+
for namespace, level in raw_log_levels.items()
|
|
56
|
+
]
|
|
57
|
+
return cls(log_levels)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Any, Callable, Mapping
|
|
5
|
+
|
|
6
|
+
from ._utils import _MISSING, _get, _parse_env_var_name, _path, _try_set
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _expand_paths(
|
|
10
|
+
source: Mapping, path_transformer: Callable[[str], str]
|
|
11
|
+
) -> dict[str, Any]:
|
|
12
|
+
expanded: dict[str, Any] = {}
|
|
13
|
+
|
|
14
|
+
def copy_value(value: Any) -> Any:
|
|
15
|
+
if isinstance(value, Mapping):
|
|
16
|
+
return _expand_paths(value, path_transformer)
|
|
17
|
+
if isinstance(value, list):
|
|
18
|
+
return [copy_value(item) for item in value]
|
|
19
|
+
return value
|
|
20
|
+
|
|
21
|
+
def populate(mapping: Mapping, parts: list[str]) -> None:
|
|
22
|
+
for key, value in mapping.items():
|
|
23
|
+
if not isinstance(key, (str, int)):
|
|
24
|
+
raise TypeError("Configuration keys must be strings or integers")
|
|
25
|
+
path = parts + [str(key)]
|
|
26
|
+
if isinstance(value, Mapping) and value:
|
|
27
|
+
populate(value, path)
|
|
28
|
+
continue
|
|
29
|
+
name = path_transformer(_path(*path))
|
|
30
|
+
existing = _get(expanded, name, default=_MISSING)
|
|
31
|
+
if isinstance(value, Mapping) and isinstance(existing, Mapping):
|
|
32
|
+
continue
|
|
33
|
+
if not _try_set(expanded, name, copy_value(value)):
|
|
34
|
+
raise ValueError(f"Conflicting configuration path {name}")
|
|
35
|
+
|
|
36
|
+
populate(source, [])
|
|
37
|
+
return expanded
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _normalize(
|
|
41
|
+
source: Mapping, *, path_transformer: Callable[[str], str] | None = None
|
|
42
|
+
) -> dict[str, Any]:
|
|
43
|
+
"""Expand paths and copy containers, normalizing indexed mappings to lists."""
|
|
44
|
+
transform = path_transformer or _parse_env_var_name
|
|
45
|
+
expanded = _expand_paths(source, transform)
|
|
46
|
+
|
|
47
|
+
def convert(value: Any) -> Any:
|
|
48
|
+
if isinstance(value, dict):
|
|
49
|
+
converted = {key: convert(item) for key, item in value.items()}
|
|
50
|
+
if converted and all(key.isdecimal() for key in converted):
|
|
51
|
+
indices = sorted(converted, key=int)
|
|
52
|
+
if len({int(key) for key in indices}) != len(indices):
|
|
53
|
+
raise ValueError("Duplicate configuration list indices")
|
|
54
|
+
return [converted[key] for key in indices]
|
|
55
|
+
return converted
|
|
56
|
+
if isinstance(value, list):
|
|
57
|
+
return [convert(item) for item in value]
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
return {key: convert(value) for key, value in expanded.items()}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _merge(
|
|
64
|
+
defaults: dict[str, Any],
|
|
65
|
+
primary: dict[str, Any],
|
|
66
|
+
*,
|
|
67
|
+
_base_path: str = "",
|
|
68
|
+
) -> dict[str, Any]:
|
|
69
|
+
"""Merge owned mappings in place; primary lists replace default lists."""
|
|
70
|
+
for key, value in primary.items():
|
|
71
|
+
if key not in defaults:
|
|
72
|
+
defaults[key] = value
|
|
73
|
+
continue
|
|
74
|
+
previous = defaults[key]
|
|
75
|
+
name = _path(_base_path, key) if _base_path else key
|
|
76
|
+
if isinstance(previous, dict) and isinstance(value, dict):
|
|
77
|
+
_merge(previous, value, _base_path=name)
|
|
78
|
+
elif isinstance(previous, dict) or isinstance(value, dict):
|
|
79
|
+
raise TypeError(f"Conflicting configuration structure at {name}")
|
|
80
|
+
else:
|
|
81
|
+
defaults[key] = value
|
|
82
|
+
return defaults
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _resolve(
|
|
86
|
+
primary: Mapping,
|
|
87
|
+
defaults: Mapping | None = None,
|
|
88
|
+
*,
|
|
89
|
+
path_transformer: Callable[[str], str] | None = None,
|
|
90
|
+
) -> dict[str, Any]:
|
|
91
|
+
"""Normalize each source independently, then merge with primary precedence."""
|
|
92
|
+
base = _normalize(
|
|
93
|
+
defaults if defaults is not None else {}, path_transformer=path_transformer
|
|
94
|
+
)
|
|
95
|
+
overrides = _normalize(primary, path_transformer=path_transformer)
|
|
96
|
+
return _merge(base, overrides)
|