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

ChatCompletionCache should support component config #5141

Open
jackgerrits opened this issue Jan 22, 2025 · 2 comments
Open

ChatCompletionCache should support component config #5141

jackgerrits opened this issue Jan 22, 2025 · 2 comments
Milestone

Comments

@jackgerrits
Copy link
Member

The new cache should support declarative configuration

@ekzhu ekzhu added this to the 0.4.4 milestone Jan 23, 2025
@victordibia
Copy link
Collaborator

Small side comment ... @jackgerrits
Would it be possible to have a simpler interface for enabling cache in the chatcompletion client?

cached_model_client = OpenAIChatCompletionClient(model="gpt-4o", cache=True)

This way ChatCompletionClient caching can be reflected in the config for the client.

@jackgerrits
Copy link
Member Author

jackgerrits commented Jan 23, 2025

This means that each model client need to implement it. The point of the current design is separation of concerns and generalizability.

This way ChatCompletionClient caching can be reflected in the config for the client.

This is the case currently - itll be a model client's config nested with the config of the cache client.

If we allow a default cache store, then the current usage can be as simple as:

cached_model_client = ChatCompletionCache(OpenAIChatCompletionClient(model="gpt-4o"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants