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

Make ChatCompletionCache support component config #5658

Merged
merged 3 commits into from
Feb 24, 2025

Conversation

victordibia
Copy link
Collaborator

@victordibia victordibia commented Feb 22, 2025

This PR makes makes ChatCompletionCache support component config

Why are these changes needed?

Ensures we have a path to serializing ChatCompletionCache , similar to the ChatCompletion client that it wraps.

This PR does the following

  • Makes CacheStore serializable first (part of this includes converting from Protocol to base class). Makes it's derivatives serializable as well (diskcache, redis)
  • Makes ChatCompletionCache serializable
  • Adds some tests

Related issue number

Closes #5141

Checks

cc @nour-bouzid

Copy link

codecov bot commented Feb 22, 2025

Codecov Report

Attention: Patch coverage is 89.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 75.63%. Comparing base (a226966) to head (56f0d49).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...autogen_ext/models/cache/_chat_completion_cache.py 76.47% 4 Missing ⚠️
...ages/autogen-core/src/autogen_core/_cache_store.py 89.47% 2 Missing ⚠️
...s/autogen-ext/src/autogen_ext/cache_store/redis.py 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5658      +/-   ##
==========================================
+ Coverage   75.56%   75.63%   +0.07%     
==========================================
  Files         171      171              
  Lines       10483    10548      +65     
==========================================
+ Hits         7921     7978      +57     
- Misses       2562     2570       +8     
Flag Coverage Δ
unittests 75.63% <89.33%> (+0.07%) ⬆️

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.

@victordibia victordibia merged commit 170b8cc into main Feb 24, 2025
54 checks passed
@victordibia victordibia deleted the chatcompletion_cache_vd branch February 24, 2025 03:49
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.

ChatCompletionCache should support component config
2 participants