-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add citation support in Python RAG CEA templates #13313
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #13313 +/- ##
==========================================
+ Coverage 90.28% 90.29% +0.01%
==========================================
Files 609 609
Lines 36146 36226 +80
Branches 7047 7244 +197
==========================================
+ Hits 32633 32709 +76
Misses 1523 1523
- Partials 1990 1994 +4 |
templates/python/custom-copilot-rag-azure-ai-search/src/custom_say_command.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR adds citation support for AI responses in Python RAG CEA templates and improves error handling for deletion failures.
- Added citation processing and formatting in custom_say_command for both custom-copilot-rag-customize and custom-copilot-rag-azure-ai-search templates.
- Enhanced error handling in delete.py by catching ServiceRequestError and printing a custom error message.
Reviewed Changes
File | Description |
---|---|
templates/python/custom-copilot-rag-customize/src/custom_say_command.py | Implements citation extraction and formatting for AI responses. |
templates/python/custom-copilot-rag-azure-ai-search/src/indexers/delete.py | Adds error handling for ServiceRequestError with a custom error message. |
templates/python/custom-copilot-rag-azure-ai-search/src/custom_say_command.py | Implements citation extraction and formatting, similar to the customize template. |
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
templates/python/custom-copilot-rag-azure-ai-search/src/indexers/delete.py
Outdated
Show resolved
Hide resolved
…ndexers/delete.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This pull request introduces citation support in the Python RAG CEA templates while also enhancing error handling when deleting an index.
- Added a new say_command function that processes AI responses with citation metadata in two separate templates.
- Updated error handling in the Azure AI Search index deletion to catch ServiceRequestError and provide a user-friendly message.
Reviewed Changes
File | Description |
---|---|
templates/python/custom-copilot-rag-customize/src/custom_say_command.py | New say_command implementation with citation support and Teams formatting. |
templates/python/custom-copilot-rag-azure-ai-search/src/indexers/delete.py | Wrapped the index deletion call in a try/except to catch ServiceRequestError and update the error message. |
templates/python/custom-copilot-rag-azure-ai-search/src/custom_say_command.py | New say_command implementation with citation support and Teams formatting. |
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
templates/python/custom-copilot-rag-azure-ai-search/src/indexers/delete.py:29
- [nitpick] Using 'e.message' may not always yield the expected error details since 'message' is not a standard attribute of Exception. Consider using 'str(e)' to ensure a reliable error message.
print(f"Delete index failed due to ServiceRequestError: {e.message}.\nPlease check your keys, models and endpoints in {os.getcwd()}/env/.env.local.user.")
workitem: https://msazure.visualstudio.com/Microsoft%20Teams%20Extensibility/_workitems/edit/31583565
along with a error handling optimization for missing keys in .env.local.user.
[New error message]:
[Old error message]: