Skip to content

feat: FirestoreRecordManager #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kurtismassey
Copy link

A record manager for Langchain Indexing based on the Langchain RecordManager Base Class as a Firestore alternative to the SQLRecordManager

Fixes #89 🦕

@kurtismassey kurtismassey requested review from a team as code owners August 10, 2024 21:39
Copy link

conventional-commit-lint-gcf bot commented Aug 10, 2024

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/langchain-google-firestore-python API. label Aug 10, 2024
@kurtismassey kurtismassey force-pushed the feature/RecordManager branch from d3ba6ed to 90db9cd Compare August 10, 2024 21:43
@kurtismassey kurtismassey changed the title Initial FirestoreRecordManager for Langchain Indexing feat: FirestoreRecordManager Aug 10, 2024
@kurtismassey kurtismassey force-pushed the feature/RecordManager branch from 90db9cd to 91ed0b7 Compare August 10, 2024 21:50
@kurtismassey kurtismassey force-pushed the feature/RecordManager branch from 0065cd6 to deb6f5f Compare August 11, 2024 11:28
@averikitsch
Copy link
Collaborator

Thank you for the PR. I will review within a couple days.

Copy link
Member

@JU-2094 JU-2094 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pass

def get_time(self) -> datetime.datetime:
return datetime.datetime.now(datetime.timezone.utc)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JU-2094 should this use the server timestamp, firestore.SERVER_TIMESTAMP?

time_at_least: Optional[float] = None,
) -> Dict[str, int]:
logger.info("Calling synchronous update method")
return self.update(keys, group_ids=group_ids, time_at_least=time_at_least)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the async client for all async methods

return result

async def aexists(self, keys: Sequence[str]) -> List[bool]:
logger.info("Calling synchronous exists method")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.info("Calling synchronous exists method")
logger.info("Calling asynchronous exists method")

from google.cloud import firestore
from langchain_google_firestore import FirestoreRecordManager

@pytest.fixture(scope="module")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the tests. Can you provide a few integration tests?

@averikitsch
Copy link
Collaborator

/gcbrun

@davlu93
Copy link

davlu93 commented Jan 6, 2025

any updates on this implementation??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/langchain-google-firestore-python API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firestore Record Manager for Langchain Indexing
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy