Summary of entries of Methods for langchain-google-firestore.
langchain_google_firestore.chat_message_history.FirestoreChatMessageHistory.add_message
add_message(message: langchain_core.messages.base.BaseMessage) -> None
Add a Message object to the store.
See more: langchain_google_firestore.chat_message_history.FirestoreChatMessageHistory.add_message
langchain_google_firestore.chat_message_history.FirestoreChatMessageHistory.clear
clear() -> None
Remove all messages from the store.
See more: langchain_google_firestore.chat_message_history.FirestoreChatMessageHistory.clear
langchain_google_firestore.document_loader.FirestoreLoader.lazy_load
lazy_load() -> typing.Iterator[langchain_core.documents.base.Document]
A lazy loader for Documents.
See more: langchain_google_firestore.document_loader.FirestoreLoader.lazy_load
langchain_google_firestore.document_loader.FirestoreLoader.load
load() -> typing.List[langchain_core.documents.base.Document]
Load Documents.
See more: langchain_google_firestore.document_loader.FirestoreLoader.load
langchain_google_firestore.document_loader.FirestoreSaver
FirestoreSaver(collection: Optional[str] = None, client: Optional[Client] = None)
Document Saver for Google Cloud Firestore.
See more: langchain_google_firestore.document_loader.FirestoreSaver
langchain_google_firestore.document_loader.FirestoreSaver.delete_documents
delete_documents(
documents: typing.List[langchain_core.documents.base.Document],
document_ids: typing.Optional[typing.List[str]] = None,
) -> None
Delete documents from the Firestore database.
See more: langchain_google_firestore.document_loader.FirestoreSaver.delete_documents
langchain_google_firestore.document_loader.FirestoreSaver.upsert_documents
upsert_documents(
documents: typing.List[langchain_core.documents.base.Document],
merge: typing.Optional[bool] = False,
document_ids: typing.Optional[typing.List[str]] = None,
) -> None
Create / merge documents into the Firestore database.
See more: langchain_google_firestore.document_loader.FirestoreSaver.upsert_documents
langchain_google_firestore.vectorstores.FirestoreVectorStore
FirestoreVectorStore(
collection: google.cloud.firestore_v1.collection.CollectionReference | str,
embedding_service: langchain_core.embeddings.embeddings.Embeddings,
client: typing.Optional[google.cloud.firestore_v1.client.Client] = None,
content_field: str = "content",
metadata_field: str = "metadata",
embedding_field: str = "embedding",
distance_strategy: typing.Optional[
google.cloud.firestore_v1.base_vector_query.DistanceMeasure
] = DistanceMeasure.COSINE,
filters: typing.Optional[google.cloud.firestore_v1.base_query.BaseFilter] = None,
)
Constructor for FirestoreVectorStore.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore
langchain_google_firestore.vectorstores.FirestoreVectorStore._encode_image
_encode_image(uri: str) -> str
Get base64 string from a image URI.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore._encode_image
langchain_google_firestore.vectorstores.FirestoreVectorStore.add_images
add_images(
uris: typing.Iterable[str],
metadatas: typing.Optional[typing.List[dict]] = None,
ids: typing.Optional[typing.List[str]] = None,
store_encodings: bool = False,
**kwargs: typing.Any
) -> typing.List[str]
Adds image embeddings to Firestore vector store.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.add_images
langchain_google_firestore.vectorstores.FirestoreVectorStore.add_texts
add_texts(
texts: typing.Iterable[str],
metadatas: typing.Optional[typing.List[dict]] = None,
ids: typing.Optional[typing.List[str]] = None,
**kwargs: typing.Any
) -> typing.List[str]
Add or update texts in the vector store.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.add_texts
langchain_google_firestore.vectorstores.FirestoreVectorStore.delete
delete(ids: typing.Optional[typing.List[str]] = None, **kwargs: typing.Any) -> None
Delete documents from the vector store.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.delete
langchain_google_firestore.vectorstores.FirestoreVectorStore.from_texts
from_texts(
texts: typing.List[str],
embedding: langchain_core.embeddings.embeddings.Embeddings,
metadatas: typing.Optional[typing.List[dict]] = None,
ids: typing.Optional[typing.List[str]] = None,
collection: typing.Optional[
typing.Union[str, google.cloud.firestore_v1.collection.CollectionReference]
] = None,
**kwargs: typing.Any
) -> langchain_google_firestore.vectorstores.FirestoreVectorStore
Create a FirestoreVectorStore instance and add texts to it.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.from_texts
langchain_google_firestore.vectorstores.FirestoreVectorStore.max_marginal_relevance_search
max_marginal_relevance_search(
query: str,
k: int = 4,
fetch_k: int = 20,
lambda_mult: float = 0.5,
filters: typing.Optional[google.cloud.firestore_v1.base_query.BaseFilter] = None,
**kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]
Run max marginal relevance search on the results of Firestore nearest neighbor search.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.max_marginal_relevance_search
langchain_google_firestore.vectorstores.FirestoreVectorStore.max_marginal_relevance_search_by_vector
max_marginal_relevance_search_by_vector(
embedding: typing.List[float],
k: int = 4,
fetch_k: int = 20,
lambda_mult: float = 0.5,
filters: typing.Optional[google.cloud.firestore_v1.base_query.BaseFilter] = None,
**kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]
Run max marginal relevance search on the results of Firestore nearest neighbor search using a vector.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.max_marginal_relevance_search_by_vector
langchain_google_firestore.vectorstores.FirestoreVectorStore.similarity_search
similarity_search(
query: str,
k: int = 4,
filters: typing.Optional[google.cloud.firestore_v1.base_query.BaseFilter] = None,
**kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]
Run similarity search with Firestore.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.similarity_search
langchain_google_firestore.vectorstores.FirestoreVectorStore.similarity_search_by_vector
similarity_search_by_vector(
embedding: typing.List[float],
k: int = 4,
filters: typing.Optional[google.cloud.firestore_v1.base_query.BaseFilter] = None,
**kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]
Run similarity search with Firestore using a vector.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.similarity_search_by_vector
langchain_google_firestore.vectorstores.FirestoreVectorStore.similarity_search_image
similarity_search_image(
image_uri: str,
k: int = 4,
filters: typing.Optional[google.cloud.firestore_v1.base_query.BaseFilter] = None,
**kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]
Run image similarity search with Firestore.
See more: langchain_google_firestore.vectorstores.FirestoreVectorStore.similarity_search_image