Add guardrail tracing #9
Merged
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.
Human notes
Robot notes beep boop
This pull request introduces several updates to the
python/devopsbot.py
file to enhance functionality, improve error handling, and refine AI interaction. Additionally, there are changes to the Terraform configuration inlambda_receiver.tf
to standardize IAM role naming. Below is a categorized summary of the most important changes.Enhancements to AI Interaction and Guardrails
guardrailTracing
to enable tracing options for guardrails (enabled
,enabled_full
,disabled
) and included it in the AI request payload (def ai_request
) to enhance security and debugging capabilities. [1] [2]model_guidance
withsystem_prompt
and updated the initialization process to useinitial_model_system_prompt
for better clarity and maintainability. [1] [2]Error Handling Improvements
ask_bedrock_llm_with_knowledge_base
to catch and log errors, including specific handling for Aurora auto-pausing scenarios, with user-friendly Slack messages prompting retries. [1] [2]VERA_DEBUG
is enabled.Refactoring for Consistency
url
fields tosource
in knowledge base responses to better represent diverse data sources (e.g., Confluence, S3). Updated all related references inrerank_text
andhandle_message_event
. [1] [2] [3]Terraform Configuration Updates
lambda_receiver.tf
by renamingUe1TiDevOpsBotReceiverRole
toDevOpsBotReceiverRole
across all related resources for improved clarity and consistency. [1] [2] [3] [4]These changes collectively improve the bot's robustness, maintainability, and user experience while aligning infrastructure naming conventions.