forked from langchain-ai/langchain
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
def embed_query(self, text: str) -> List[float]: | |
"""Return consistent embeddings for the text, if seen before, or a constant | |
one if the text is unknown.""" | |
if text not in self.known_texts: | |
return [float(1.0)] * (self.dimensionality - 1) + [float(0.0)] | |
return [float(1.0)] * (self.dimensionality - 1) + [ | |
float(self.known_texts.index(text)) | |
] |
This spot has been resolved differently. We will need to check if that will be fine. Otherwise, we will need to use the previous code on behalf of a separate FakeEmbeddings
fixture.
- Tests: Fix regression in
ConsistentFakeEmbeddings.embed_query
langchain-ai/langchain#13654 (comment) - fake consistent embeddings cleanup langchain-ai/langchain#14256
Originally posted by @amotl in #1 (comment)
/cc @kneth
Metadata
Metadata
Assignees
Labels
No labels