Allow for fixed returns when using FakeEmbeddings from langchain_community #21550
Closed
vincentsyha
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked
Feature request
Allow FakeEmbeddings to return fixed results when called. Currently it generates new vectors on each call.
Motivation
When writing unit tests it would be useful to ensure that the fake embeddings returned from calling this method on the same string were consistent. For example I have a function to calculate cosine similarity between a set of embeddings, the function returns the string with the maximal cosine similarity. Without the ability to return a fixed vector on the same string the unit test becomes a bit more complex.
Proposal (If applicable)
No response
Beta Was this translation helpful? Give feedback.
All reactions