azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

Add chat history feature

Open fujita-h opened this issue 1 year ago • 5 comments

This commit adds the following new files:

  • HistoryItem: A new component for displaying chat history items.
  • HistoryPanel: A new component for displaying the chat history panel.
  • HistoryButton: A new component for opening the chat history.
  • HistoryProviders: A new module containing history provider classes.

These changes include functionality to support future enhancements to the chat history feature.

The chat history feature is only enabled when you explicitly set the environment variable USE_CHAT_HISTORY.

The history function uses the browser's IndexedDB. I understand that there is also an approach to use CosmosDB, but this requires enabling authentication to identify users, so I decided to start with IndexedDB, which does not depend on authentication.

To make it easier to implement other data stores, I made it easier to implement additional data stores with HistoryProviders.

Related: #977 #1863 #259

Purpose

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

[ ] Bugfix
[x] 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.

  • [x] The current tests all pass (python -m pytest).
  • [ ] I added tests that prove my fix is effective or that my feature works
  • [x] I ran python -m pytest --cov to verify 100% coverage of added lines
  • [x] I ran python -m mypy to check for type errors
  • [x] I either used the pre-commit hooks or ran ruff and black manually on my code.

fujita-h avatar Sep 25 '24 00:09 fujita-h