mirror of
https://github.com/Mintplex-Labs/langchain-python.git
synced 2026-07-22 09:15:31 -04:00
49b65a1b57
Hello, this PR improves coverage for caching by the two Cassandra-related caches (i.e. exact-match and semantic alike) by switching to the more general `dumps`/`loads` serdes utilities. This enables cache usage within e.g. `ChatOpenAI` contexts (which need to store lists of `ChatGeneration` instead of `Generation`s), which was not possible as long as the cache classes were relying on the legacy `_dump_generations_to_json` and `_load_generations_from_json`). Additionally, a slightly different init signature is introduced for the cache objects: - named parameters required for init, to pave the way for easier changes in the future connect-to-db flow (and tests adjusted accordingly) - added a `skip_provisioning` optional passthrough parameter for use cases where the user knows the underlying DB table, etc already exist. Thank you for a review!