googleapis / langchain-google-firestore-python

Apache License 2.0
21 stars 11 forks source link

similarity_search_with_score() raises NotImplementedError #87

Open dtan2-wiq opened 4 months ago

dtan2-wiq commented 4 months ago

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

Steps to reproduce

  1. Install langchain-google-firestore 0.3.0 and run the code below

Code example

from langchain_core.documents import Document
from langchain_google_firestore import FirestoreVectorStore
from langchain_google_vertexai import VertexAIEmbeddings

embeddings = VertexAIEmbeddings(model_name="textembedding-gecko@latest")

# Load data
data = ["blue and yellow makes green", "red and orange makes yellow", "white and black makes grey"]

docs = [Document(page_content=d) for d in data]
vector_store = FirestoreVectorStore.from_documents(
    collection="colors",
    documents=docs,
    embedding=embeddings,
)

vector_store.similarity_search_with_score("green") # this raises NotImplementError

Stack trace

Traceback (most recent call last):
  File "/demo/vector_store_demo/main.py", line 21, in <module>
    vector_store.similarity_search_with_score("green")
  File "/demo/.venv/lib/python3.12/site-packages/langchain_core/vectorstores/base.py", line 679, in similarity_search_with_score
    raise NotImplementedError
NotImplementedError
averikitsch commented 3 months ago

At this time, we can not support the method: similarity_search_with_score() due to underlying client library functionality.