azure-search-openai-demo
azure-search-openai-demo copied to clipboard
Update ask_answer_question.prompty to include instruction to list sources in square brackets #2473
Purpose
Update the file app/backend/approaches/prompts/ask_answer_question.prompty to include the following instruction, similar to the one in chat_answer_question.prompty:
Each source has a name followed by the actual information, always include the source name for each fact you use in the response. Use square brackets to reference the source, for example [info1.txt]. Don't combine sources, list each source separately, for example [info1.txt][info2.pdf].
By adding this instruction, the "Ask your data" mode should render citations correctly.
Does this introduce a breaking change?
When developers merge from main and run the server, azd up, or azd deploy, will this produce an error? If you're not sure, try it out on an old environment.
[ ] Yes
[ x] No
Does this require changes to learn.microsoft.com docs?
This repository is referenced by this tutorial which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial, check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.
[ ] Yes
[ x] No
Type of change
[x ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:
Code quality checklist
See CONTRIBUTING.md for more details.
- [ ] The current tests all pass (
python -m pytest). - [ ] I added tests that prove my fix is effective or that my feature works
- [ ] I ran
python -m pytest --covto verify 100% coverage of added lines - [ ] I ran
python -m mypyto check for type errors - [ ] I either used the pre-commit hooks or ran
ruffandblackmanually on my code.
@fabod You'll need to run python -m pytest --snapshot-update per the steps in CONTRIBUTING.md
I tried to do that myself and update the PR, but since you forked off the main branch in your repository (versus a non-main branch), it won't let me to that.
Once you update the snapshots, the tests should all pass. Thanks!
I incorporated your suggestion in this PR: https://github.com/Azure-Samples/azure-search-openai-demo/pull/2709 And also made a few other changes for consistency. Thanks for raising this! I'll close the PR now.