Skip to content

Added disambiguation (both hardcoded and bedrock driven responses)#3

Merged
kenerwin88 merged 6 commits intomainfrom
disambiguation
Sep 15, 2025
Merged

Added disambiguation (both hardcoded and bedrock driven responses)#3
kenerwin88 merged 6 commits intomainfrom
disambiguation

Conversation

@kenerwin88
Copy link
Contributor

- 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.
@kenerwin88 kenerwin88 merged commit a2a274c into main Sep 15, 2025
10 checks passed
@kenerwin88 kenerwin88 deleted the disambiguation branch September 15, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant