Added disambiguation (both hardcoded and bedrock driven responses)#3
Merged
kenerwin88 merged 6 commits intomainfrom Sep 15, 2025
Merged
Added disambiguation (both hardcoded and bedrock driven responses)#3kenerwin88 merged 6 commits intomainfrom
kenerwin88 merged 6 commits intomainfrom
Conversation
- Add DisambiguationAnalyzer for intelligent intent analysis - Add DisambiguationHandler for user-friendly clarification responses - Add comprehensive configuration options via DisambiguationConfig - Integrate disambiguation into LexHelper with enable_disambiguation flag - Add session attributes for disambiguation state management - Include extensive test coverage (unit, integration, edge cases) - Add documentation and example implementation - Support custom intent groups and clarification messages - Implement multiple selection methods (text, numbers, letters) - Add graceful fallbacks and error handling - Maintain full backward compatibility This feature helps resolve ambiguous user input by presenting clarifying options when confidence scores are low or similar, improving user experience and reducing frustration in conversational interfaces.
- Add BedrockDisambiguationGenerator for AI-powered text generation - Add BedrockDisambiguationConfig for Bedrock integration settings - Integrate Bedrock into DisambiguationHandler for contextual messages - Generate intelligent clarification text based on user input - Create smart button labels that are more intuitive than display names - Support graceful fallback to static messages if Bedrock fails - Add comprehensive test coverage for Bedrock integration - Include example implementation with Bedrock configuration - Update documentation with Bedrock setup and benefits This enhancement uses Amazon Bedrock models to generate contextual, natural language disambiguation messages that acknowledge the user's specific input and provide more conversational, helpful responses compared to static templates.
- Update main lambda_function.py to include both static and Bedrock disambiguation - Add environment variable configuration for flexible deployment - Remove separate example files (lambda_function_with_disambiguation.py, lambda_function_with_bedrock_disambiguation.py) - Add comprehensive documentation and usage examples in code - Support runtime configuration via ENABLE_BEDROCK_DISAMBIGUATION env var - Include proper logging for disambiguation mode selection - Update documentation to reference the consolidated example - Fix type annotations in Bedrock generator for pyright compliance This simplifies the example structure while providing both static and AI-powered disambiguation in a single, production-ready implementation that can be configured via environment variables.
- Configure CDK to set LOG_LEVEL=DEBUG for enhanced debugging - Add Bedrock environment variables to CDK stack for AI-powered disambiguation - Update lambda function to support configurable log levels via environment variables - Add comprehensive Smart Disambiguation section to README.md - Include disambiguation in Core Features and Why Use Lex Helper sections - Add practical examples showing static vs AI-powered disambiguation - Update table of contents to include new disambiguation documentation The CDK now automatically configures: - LOG_LEVEL=DEBUG for detailed debugging output - ENABLE_BEDROCK_DISAMBIGUATION=true for AI-powered responses - BEDROCK_MODEL_ID and other Bedrock configuration parameters - Proper IAM permissions for Bedrock access This makes debugging and monitoring much easier in production deployments.
- Remove message_manager_test_script.py (superseded by automatic initialization) - Remove config_test_script.py (superseded by framework features) These scripts were development utilities that tested manual MessageManager initialization patterns. The lex-helper framework now handles this automatically with auto_initialize_messages=True (default), making these scripts redundant. Proper unit tests in tests/test_message_manager_auto_init.py provide comprehensive coverage of this functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Add Smart Disambiguation feature for ambiguous user input
@kenerwin88
kenerwin88 committed 5 days ago
feat: Add Bedrock-powered intelligent disambiguation
@kenerwin88
kenerwin88 committed 5 days ago
refactor: Consolidate disambiguation examples into main lambda function