Skip to content
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

AutoGen cache using Azure Cosmos DB #2327

Merged
merged 170 commits into from
Apr 26, 2024
Merged

AutoGen cache using Azure Cosmos DB #2327

merged 170 commits into from
Apr 26, 2024

Conversation

wmwxwa
Copy link
Collaborator

@wmwxwa wmwxwa commented Apr 8, 2024

Why are these changes needed?

Related issue number

Checks

autogen/cache/cosmos_db_cache.py Outdated Show resolved Hide resolved
autogen/cache/cosmos_db_cache.py Outdated Show resolved Hide resolved
autogen/cache/cosmos_db_cache.py Outdated Show resolved Hide resolved
autogen/cache/cosmos_db_cache.py Outdated Show resolved Hide resolved
@ekzhu ekzhu requested a review from jackgerrits April 10, 2024 06:40
autogen/cache/cosmos_db_cache.py Outdated Show resolved Hide resolved
autogen/cache/cosmos_db_cache.py Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2024

Codecov Report

Attention: Patch coverage is 74.07407% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 33.84%. Comparing base (ded2d61) to head (dd6b1ac).
Report is 6 commits behind head on main.

Files Patch % Lines
autogen/cache/cache_factory.py 40.00% 12 Missing ⚠️
autogen/cache/cosmos_db_cache.py 85.41% 6 Missing and 1 partial ⚠️
autogen/cache/cache.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2327      +/-   ##
==========================================
+ Coverage   33.33%   33.84%   +0.50%     
==========================================
  Files          83       82       -1     
  Lines        8636     8787     +151     
  Branches     1835     1863      +28     
==========================================
+ Hits         2879     2974      +95     
- Misses       5516     5563      +47     
- Partials      241      250       +9     
Flag Coverage Δ
unittests 33.84% <74.07%> (+0.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cheng-tan
Copy link
Contributor

Thank you for the PR.

@ekzhu
Copy link
Collaborator

ekzhu commented Apr 11, 2024

For using cosmos db cache, we can add to https://github.com/microsoft/autogen/blob/6d2c923424991c95cc9326e76c695d2f4721632e/website/docs/topics/llm-caching.md

@sonichi
Copy link
Collaborator

sonichi commented Apr 12, 2024

Could you fix https://github.com/microsoft/autogen/actions/runs/8653772822/job/23729679030?pr=2327 ?
You can use pre-commit to help.

@ekzhu
Copy link
Collaborator

ekzhu commented Apr 12, 2024

Thanks for this effort! @wmwxwa We also want to add Cosmos DB to our ecosystem page: https://microsoft.github.io/autogen/docs/ecosystem. It is located in website/docs/ecosystem.

BTW, our vector database module is ready:

class VectorDB(Protocol):
You can take a look and see if it is easy to add Cosmos DB as a vector database implementation.

@wmwxwa
Copy link
Collaborator Author

wmwxwa commented Apr 25, 2024

Thank you for the PR.

Is there another notebook on caching?

@ekzhu
Copy link
Collaborator

ekzhu commented Apr 26, 2024

Thanks!

Also is it possible to add examples for how to use cosmos logger and how to use cosmos db cache in this logging notebook? https://github.com/microsoft/autogen/blob/main/notebook/agentchat_logging.ipynb

Is there another notebook on caching?

The documentation is in llm_cache.md.

@ekzhu ekzhu added this pull request to the merge queue Apr 26, 2024
@ekzhu ekzhu removed this pull request from the merge queue due to a manual request Apr 26, 2024
@ekzhu ekzhu added this pull request to the merge queue Apr 26, 2024
Merged via the queue into microsoft:main with commit fbcc56c Apr 26, 2024
28 of 42 checks passed
@sonichi
Copy link
Collaborator

sonichi commented Apr 28, 2024

This PR is merged prematurely without running openai test. The test failure is under fix by #2490

jayralencar pushed a commit to jayralencar/autogen that referenced this pull request May 28, 2024
* Create cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Create test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cache.py

* Update cache_factory.py

* Update test_cache.py

* Update test_cache.py

* Update cache.py

* Update llm-caching.md

* Update cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update build.yml

* Update build.yml

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update autogen/cache/cache_factory.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update .github/workflows/build.yml

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cache_factory.py

* Update cache.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cache.py

* Update cache_factory.py

* Update test_cache.py

* Update test_cache.py

* Update cache.py

* Update cache.py

* Update test_cache.py

* Update cache.py

* Update cache.py

* Update cache_factory.py

* Update cache_factory.py

* Update cache_factory.py

* Update cache_factory.py

* Update cache_factory.py

* Update build.yml

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update test_cache.py

* Update cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml

* Update cache_factory.py

* Update cache.py

* Update cosmos_db_cache.py

* Update cache.py

* Update build.yml

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update cache_factory.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update test_cache.py

* Update test_cosmos_db_cache.py

* Update cache.py

* Update cache.py

* Update cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

* Update cache.py

* Update test_cosmos_db_cache.py

* Update cosmos_db_cache.py

* Update cache.py

* Update test_cosmos_db_cache.py

* Update test_cosmos_db_cache.py

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
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.

None yet

8 participants